HTTP proxy
Enable traffic through a proxy server using the HTTP_PROXY environment variable.
Fluent Bit supports configuring an HTTP proxy for all egress HTTP/HTTPS traffic using theHTTP_PROXY orhttp_proxy environment variable.
The format for the HTTP proxy environment variable ishttp://USER:PASS@HOST:PORT, where:
USERis the username when using basic authentication.PASSis the password when using basic authentication.HOSTis the HTTP proxy hostname or IP address.PORTis the port the HTTP proxy is listening on.
To use an HTTP proxy with basic authentication, provide the username and password:
HTTP_PROXY='http://example_user:[email protected]:8080'When no authentication is required, omit the username and password:
HTTP_PROXY='http://proxy.example.com:8080'TheHTTP_PROXY environment variable is astandard way of setting a HTTP proxy in a containerized environment, and it's also natively supported by any application written in Go. Fluent Bit implements the same convention. Thehttp_proxy environment variable is also supported. When both theHTTP_PROXY andhttp_proxy environment variables are provided,HTTP_PROXY will be preferred.
TheHTTP output plugin also supports configuring an HTTP proxy. This configuration works, but shouldn't be used with theHTTP_PROXY orhttp_proxy environment variable. The environment variable-based proxy configuration is implemented by creating a TCP connection tunnel usingHTTP CONNECT. Unlike the plugin's implementation, this supports both HTTP and HTTPS egress traffic.
NO_PROXY
NO_PROXYUse theNO_PROXY environment variable when traffic shouldn't flow through the HTTP proxy. Theno_proxy environment variable is also supported. When bothNO_PROXY andno_proxy environment variables are provided,NO_PROXY takes precedence.
The format for theno_proxy environment variable is a comma-separated list of host names or IP addresses.
A domain name matches itself and all of its subdomains (for example,example.com matches bothexample.com andtest.example.com):
NO_PROXY='foo.com,127.0.0.1,localhost'A domain with a leading dot (.) matches only its subdomains (for example,.example.com matchestest.example.com but notexample.com):
As an example, you might useNO_PROXY when running Fluent Bit in a Kubernetes environment, where and you want:
All real egress traffic to flow through an HTTP proxy.
All local Kubernetes traffic to not flow through the HTTP proxy.
In this case, set:
Last updated
Was this helpful?