-
Notifications
You must be signed in to change notification settings - Fork 540
admin: proxy: update http proxy for style #1501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
esmerel
merged 4 commits into
master
from
lynettemiles/sc-105734/update-administration-http-proxy-md-fluent
Nov 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,81 @@ | ||
| --- | ||
| description: Enable traffic through a proxy server via HTTP_PROXY environment variable | ||
| description: Enable traffic through a proxy server using the HTTP_PROXY environment variable. | ||
| --- | ||
|
|
||
| # HTTP Proxy | ||
|
|
||
| Fluent Bit supports configuring an HTTP proxy for all egress HTTP/HTTPS traffic via the `HTTP_PROXY` or `http_proxy` environment variable. | ||
| Fluent Bit supports configuring an HTTP proxy for all egress HTTP/HTTPS traffic | ||
| using the `HTTP_PROXY` or `http_proxy` environment variable. | ||
|
|
||
| The format for the HTTP proxy environment variable is `http://USER:PASS@HOST:PORT`, where: | ||
|
|
||
| * `USER` is the username when using basic authentication. | ||
| * `PASS` is the password when using basic authentication. | ||
| * `HOST` is the HTTP proxy hostname or IP address. | ||
| * `PORT` is the port the HTTP proxy is listening on. | ||
| - _`USER`_ is the username when using basic authentication. | ||
| - _`PASS`_ is the password when using basic authentication. | ||
| - _`HOST`_ is the HTTP proxy hostname or IP address. | ||
| - _`PORT`_ is the port the HTTP proxy is listening on. | ||
|
|
||
| To use an HTTP proxy with basic authentication, provide the username and password: | ||
|
|
||
| ```bash | ||
| ```text | ||
| HTTP_PROXY='http://example_user:[email protected]:8080' | ||
| ``` | ||
|
|
||
| When no authentication is required, omit the username and password: | ||
|
|
||
| ```bash | ||
| ```text | ||
| HTTP_PROXY='http://proxy.example.com:8080' | ||
| ``` | ||
|
|
||
| The `HTTP_PROXY` environment variable is a [standard way](https://docs.docker.com/network/proxy/#use-environment-variables) 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_proxy` environment variable is also supported. When both the `HTTP_PROXY` and `http_proxy` environment variables are provided, `HTTP_PROXY` will be preferred. | ||
| The `HTTP_PROXY` environment variable is a [standard | ||
| way](https://docs.docker.com/network/proxy/#use-environment-variables) for 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. The | ||
| `http_proxy` environment variable is also supported. When both the `HTTP_PROXY` and | ||
| `http_proxy` environment variables are provided, `HTTP_PROXY` will be preferred. | ||
|
|
||
| {% hint style="info" %} | ||
| **Note**: The [HTTP output plugin](https://docs.fluentbit.io/manual/pipeline/outputs/http) also supports configuring an HTTP proxy. This configuration continues to work, however it _should not_ be used together with the `HTTP_PROXY` or `http_proxy` environment 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](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT). Unlike the plugin's implementation, this supports both HTTP and HTTPS egress traffic. | ||
|
|
||
| The [HTTP output plugin](https://docs.fluentbit.io/manual/pipeline/outputs/http) also | ||
| supports configuring an HTTP proxy. This configuration works, but shouldn't be used | ||
| with the `HTTP_PROXY` or `http_proxy` environment variable. The environment | ||
| variable-based proxy configuration is implemented by creating a TCP connection tunnel | ||
| using | ||
| [HTTP CONNECT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT). Unlike | ||
| the plugin's implementation, this supports both HTTP and HTTPS egress traffic. | ||
|
|
||
| {% endhint %} | ||
|
|
||
| # NO_PROXY | ||
| ## `NO_PROXY` | ||
|
|
||
| Not all traffic should flow through the HTTP proxy. In this case, the `NO_PROXY` or `no_proxy` environment variable should be used. | ||
| Use the `NO_PROXY` environment variable when traffic shouldn't flow through the HTTP | ||
| proxy. The `no_proxy` environment variable is also supported. When both `NO_PROXY` | ||
| and `no_proxy` environment variables are provided, `NO_PROXY` takes precedence. | ||
|
|
||
| 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. | ||
| The format for the `no_proxy` environment variable is a comma-separated list of | ||
| host names or IP addresses. | ||
|
|
||
| A domain name matches itself and all its subdomains (i.e. `foo.com` matches `foo.com` and `bar.foo.com`): | ||
| A domain name matches itself and all its subdomains (for example:`example.com` matches | ||
| `example.com` and `test.example.com`): | ||
esmerel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| ```text | ||
| NO_PROXY='foo.com,127.0.0.1,localhost' | ||
| ``` | ||
|
|
||
| A domain with a leading `.` only matches its subdomains (i.e. `.foo.com` matches `bar.foo.com` but not `foo.com`): | ||
| A domain with a leading dot (`.`) only matches its subdomains (for example: | ||
esmerel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `.example.com` matches `test.example.com` but not `example.com`): | ||
|
|
||
| ```bash | ||
| NO_PROXY='.foo.com,127.0.0.1,localhost' | ||
| ```text | ||
| NO_PROXY='.example.com,127.0.0.1,localhost' | ||
| ``` | ||
|
|
||
| One typical use case for `NO_PROXY` is when running Fluent Bit in a Kubernetes environment, where we want: | ||
| As an example, you might use `NO_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. | ||
| - 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: | ||
| In this case, set: | ||
|
|
||
| ```bash | ||
| ```text | ||
| NO_PROXY='127.0.0.1,localhost,kubernetes.default.svc' | ||
| ``` | ||
|
|
||
| For convenience and compatibility, the `no_proxy` environment variable is also supported. When both the `NO_PROXY` and `no_proxy` environment variables are provided, `NO_PROXY` will be preferred. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.