Enable traffic through a proxy server via HTTP_PROXY environment variable
Fluent Bit supports configuring an HTTP proxy for all egress HTTP/HTTPS traffic via the
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:
When no authentication is required, omit the username and password:
HTTP_PROXYenvironment variable is a standard way for setting a HTTP proxy in a containerized environment, and it is also natively supported by any application written in Go. Therefore, we follow and implement the same convention for Fluent Bit. For convenience and compatibility, the
http_proxyenvironment variable is also supported. When both the
http_proxyenvironment variables are provided,
HTTP_PROXYwill be preferred.
Note: The HTTP output plugin also supports configuring an HTTP proxy. This configuration continues to work, however it should not be used together with the
http_proxyenvironment variable. This is because under the hood, the environment variable based proxy configuration is implemented by setting up a TCP connection tunnel via HTTP CONNECT. Unlike the plugin's implementation, this supports both HTTP and HTTPS egress traffic.
Not all traffic should flow through the HTTP proxy. In this case, the
no_proxyenvironment variable should be used.
The format for the no proxy environment variable is a comma-separated list of hostnames or IP addresses whose traffic should not flow through the HTTP proxy.
A domain name matches itself and all its subdomains (i.e.
A domain with a leading
.only matches its subdomains (i.e.
One typical use case for
NO_PROXYis when running Fluent Bit in a Kubernetes environment, where we 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, we can set:
For convenience and compatibility, the
no_proxyenvironment variable is also supported. When both the
no_proxyenvironment variables are provided,
NO_PROXYwill be preferred.