add documentation for NO_PROXY var in systemd config

This commit is contained in:
Jan Vaehsen (Windows) 2019-01-25 13:10:06 +01:00
parent f3960c3d31
commit 61be95d7f6
1 changed files with 19 additions and 9 deletions

View File

@ -96,24 +96,34 @@ you need to add this configuration in the Docker systemd service file.
```
3. If you have internal Docker registries that you need to contact without
proxying you can specify them via the `NO_PROXY` environment variable:
proxying you can specify them via the `NO_PROXY` environment variable.
The `NO_PROXY` variable specifies a string that contains comma-separated values for hosts that should be excluded from proxying.
These are the options you have to specify the excluded hosts:
* IP address prefix (`1.2.3.4`) or in CIDR notation (`1.2.3.4/8`)
* Domain name, or a special DNS label (`*`)
* A domain name matches that name and all subdomains. A domain name with
a leading "." matches subdomains only. Example:
```
Given the domains foo.example.com and example.com.
"foo.com" matches "foo.com" and "bar.foo.com"
".foo.com" mataches only "bar.foo.com"
```
* A single asterisk (*) indicates that no proxying should be done
* Literal port numbers are accepted by IP address prefixes (`1.2.3.4:80`) and domain names (`foo.example.com:80`)
Config examples:
```conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
```
Or, if you are behind an HTTPS proxy server:
```conf
[Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
```
The NO_PROXY variable accepts wildcards. You just need to have a value starting with a dot:
```conf
[Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443/" "NO_PROXY=localhost,127.0.0.1,.somecorporation.com"
Environment="HTTPS_PROXY=https://proxy.example.com:443/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
```
4. Flush changes: