You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`PROXY_SERVICE_HOST` - The upstream host you want this service to proxy.
30
30
*`PROXY_SERVICE_PORT` - The port of the upstream host you want this service to proxy.
31
-
*`NAXSI_RULES_URL_CSV` - A CSV of [Naxsi](https://github.com/nbs-system/naxsi) URL's of files to download and use.
31
+
*`NAXSI_RULES_URL_CSV` - A CSV of [Naxsi](https://github.com/nbs-system/naxsi) URL's of files to download and use.
32
32
(Files must end in .rules to be loaded)
33
33
*`NAXSI_RULES_MD5_CSV` - A CSV of md5 hashes for the files specified above
34
-
*`EXTRA_NAXSI_RULES` - Allows NAXSI rules to be specified as an environment variable. This allows one or two extra
34
+
*`EXTRA_NAXSI_RULES` - Allows NAXSI rules to be specified as an environment variable. This allows one or two extra
35
35
rules to be specified without downloading or mounting in a rule file.
36
36
*`NAXSI_USE_DEFAULT_RULES` - If set to "FALSE" will delete the default rules file.
37
37
*`ENABLE_UUID_PARAM` - If set to "FALSE", will NOT add a UUID url parameter to all requests. The Default will add this
@@ -43,33 +43,34 @@ rules to be specified without downloading or mounting in a rule file.
43
43
*`ERROR_REDIRECT_CODES` - Can override when Nginx will redirect requests to its own error page. Defaults to
44
44
"`500 501 502 503 504`". To support a new code, say `505`, an error page must be provided at
45
45
`/usr/local/openresty/nginx/html/505.shtml`, see [Useful File Locations](#useful-file-locations).
46
-
*`ADD_NGINX_LOCATION_CFG` - Arbitrary extra NGINX configuration to be added to the location context, see
46
+
*`ADD_NGINX_LOCATION_CFG` - Arbitrary extra NGINX configuration to be added to the location context, see
47
47
[Arbitrary Config](#arbitrary-config).
48
48
*`PORT_IN_HOST_HEADER` - If FALSE will remove the port from the http `Host` header.
49
49
*`BASIC_AUTH` - Define a path for username and password file (in `username:password` format), this will turn the file into a .htpasswd file.
50
50
*`REQS_PER_MIN_PER_IP` - Will limit requests based on IP e.g. set to 60 to allow one request per second.
51
51
*`CONCURRENT_CONNS_PER_IP` - Will limit concurrent connections based on IP e.g. set to 10 to allow max of 10 connections per browser or proxy!
52
52
*`REQS_PER_PAGE` - Will limit requests to 'bursts' of x requests at a time before terminating (will default to 20)
53
53
*`DENY_COUNTRY_ON` - Set to `TRUE` to deny access to countries not listed in ALLOW_COUNTRY_CSV with 403 status for a location (set location for 403 with ADD_NGINX_LOCATION_CFG).
54
+
*`VERBOSE_ERROR_PAGES` - Set to TRUE to display debug info in 418 error pages.
54
55
55
56
#### Single set Variables
56
57
57
58
Note the following variables can only be set once:
58
59
59
-
*`ADD_NGINX_SERVER_CFG` - Arbitrary extra NGINX configuration to be added to the server context, see
60
+
*`ADD_NGINX_SERVER_CFG` - Arbitrary extra NGINX configuration to be added to the server context, see
60
61
[Arbitrary Config](#arbitrary-config)
61
62
*`ADD_NGINX_HTTP_CFG` - Arbitrary extra NGINX configuration to be added to the http context, see
62
63
[Arbitrary Config](#arbitrary-config)
63
-
*`LOCATIONS_CSV` - Set to a list of locations that are to be independently proxied, see the example
64
-
[Using Multiple Locations](#using-multiple-locations). Note, if this isn't set, `/` will be used as the default
64
+
*`LOCATIONS_CSV` - Set to a list of locations that are to be independently proxied, see the example
65
+
[Using Multiple Locations](#using-multiple-locations). Note, if this isn't set, `/` will be used as the default
65
66
location.
66
-
*`LOAD_BALANCER_CIDR` - Set to preserve client IP addresses. *Important*, to enable, see
67
+
*`LOAD_BALANCER_CIDR` - Set to preserve client IP addresses. *Important*, to enable, see
67
68
[Preserve Client IP](#preserve-client-ip).
68
-
*`NAME_RESOLVER` - Can override the *default* DNS server used to re-resolve the backend proxy (based on TTL).
69
-
The *Default DNS Server* is the first entry in the resolve.conf file in the container and is normally correct and
70
-
managed by Docker or Kubernetes.
69
+
*`NAME_RESOLVER` - Can override the *default* DNS server used to re-resolve the backend proxy (based on TTL).
70
+
The *Default DNS Server* is the first entry in the resolve.conf file in the container and is normally correct and
71
+
managed by Docker or Kubernetes.
71
72
*`CLIENT_MAX_BODY_SIZE` - Can set a larger upload than Nginx defaults in MB.
72
-
*`HTTPS_REDIRECT_PORT` - Only required for http to https redirect and only when a non-standard https port is in use.
73
+
*`HTTPS_REDIRECT_PORT` - Only required for http to https redirect and only when a non-standard https port is in use.
73
74
This is useful when testing or for development instances or when a load-balancer mandates a non-standard port.
74
75
*`LOG_FORMAT_NAME` - Can be set to `text` or `json` (default).
75
76
*`NO_LOGGING_URL_PARAMS` - Can be set to `TRUE` if you don't want to log url params. Default is empty which means URL params are logged
@@ -100,17 +101,17 @@ N.B. see HTTP(S)_LISTEN_PORT above
100
101
### Useful File Locations
101
102
102
103
*`nginx.conf` is stored at `/usr/local/openresty/nginx/conf/nginx.conf`
103
-
*`/etc/keys/crt` & `/etc/keys/key` - A certificate can be mounted here to make OpenResty use it. However a self
104
+
*`/etc/keys/crt` & `/etc/keys/key` - A certificate can be mounted here to make OpenResty use it. However a self
104
105
signed one is provided if they have not been mounted.
105
-
*`/etc/keys/client-ca` If a client CA is mounted here, it will be loaded and configured.
106
+
*`/etc/keys/client-ca` If a client CA is mounted here, it will be loaded and configured.
106
107
See `CLIENT_CERT_REQUIRED` above in [Environment Variables](#environment-variables).
107
108
*`/etc/keys/upstream-server-ca` A CA public cert must be mounted here when verifying the upstream server's certificate is required.
108
109
See `VERIFY_SERVER_CERT` above in [Environment Variables](#environment-variables).
109
110
*`/etc/keys/upstream-client-crt` A public client cert must be mounted here when when the upstream server requires client cert authentication.
110
111
See `USE_UPSTREAM_CLIENT_CERT` above in [Environment Variables](#environment-variables).
111
112
*`/etc/keys/upstream-client-key` A private client key must be mounted here when when the upstream server requires client cert authentication.
112
113
See `USE_UPSTREAM_CLIENT_CERT` above in [Environment Variables](#environment-variables).
113
-
*`/usr/local/openresty/naxsi/*.conf` - [Naxsi](https://github.com/nbs-system/naxsi) rules location in default
114
+
*`/usr/local/openresty/naxsi/*.conf` - [Naxsi](https://github.com/nbs-system/naxsi) rules location in default
114
115
nginx.conf.
115
116
*`/usr/local/openresty/nginx/html/$CODE.shtml` - HTML (with SSI support) displayed when a the status code $CODE
116
117
is encountered upstream and the proxy is configured to intercept. See ERROR_REDIRECT_CODES to change this.
@@ -145,13 +146,13 @@ This proxy supports [Proxy Protocol](http://www.haproxy.org/download/1.5/doc/pro
145
146
146
147
To use this feature you will need:
147
148
148
-
* To enable [proxy protocol](http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) on your load balancer.
149
+
* To enable [proxy protocol](http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) on your load balancer.
149
150
For AWS, see [Enabling Proxy Protocol for AWS](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html).
150
-
* Find the private address range of your load balancer.
151
+
* Find the private address range of your load balancer.
151
152
For AWS, this could be any address in the destination network. E.g.
152
153
if you have three compute subnets defined as 10.50.0.0/24, 10.50.1.0/24 and 10.50.2.0/24,
153
154
then a suitable range would be 10.50.0.0/22 see [CIDR Calculator](http://www.subnet-calculator.com/cidr.php).
154
-
155
+
155
156
```shell
156
157
docker run -e 'PROXY_SERVICE_HOST=http://stackexchange.com' \
157
158
-e 'PROXY_SERVICE_PORT=80' \
@@ -176,11 +177,11 @@ docker run -e 'PROXY_SERVICE_HOST=http://myapp.svc.cluster.local' \
176
177
177
178
#### Using Multiple Locations
178
179
179
-
When the LOCATIONS_CSV option is set, multiple locations can be proxied. The settings for each proxy location can be
180
+
When the LOCATIONS_CSV option is set, multiple locations can be proxied. The settings for each proxy location can be
180
181
controlled with the use of any [Multi-location Variables](#multi-location-variables) by suffixing the variable name with
181
-
both a number, and the '_' character, as listed in the LOCATIONS_CSV variable.
182
-
183
-
##### Two servers
182
+
both a number, and the '_' character, as listed in the LOCATIONS_CSV variable.
183
+
184
+
##### Two servers
184
185
185
186
The example below configures a simple proxy with two locations '/' (location 1) and '/api' (location 2):
186
187
@@ -192,7 +193,7 @@ docker run -e 'PROXY_SERVICE_HOST_1=http://stackexchange.com' \
192
193
-e 'LOCATIONS_CSV=/,/api' \
193
194
-p 8443:443 \
194
195
quay.io/ukhomeofficedigital/nginx-proxy:v1.0.0
195
-
```
196
+
```
196
197
197
198
For more detail, see the [generated config](./docs/GeneratedConfigs.md#two-separate-proxied-servers).
198
199
@@ -235,7 +236,7 @@ docker run -e 'PROXY_SERVICE_HOST=http://serverfault.com' \
235
236
-p 8443:443 \
236
237
quay.io/ukhomeofficedigital/nginx-proxy:v1.0.0
237
238
```
238
-
See [./client_certs](./client_certs) for scripts that can be used to generate a CA and client certs.
239
+
See [./client_certs](./client_certs) for scripts that can be used to generate a CA and client certs.
239
240
240
241
#### Upstream Client Certs
241
242
@@ -332,19 +333,19 @@ docker run -e 'PROXY_SERVICE_HOST=http://serverfault.com' \
332
333
quay.io/ukhomeofficedigital/nginx-proxy:v1.0.0
333
334
```
334
335
335
-
this will setup basic-auth for the the `/about` location or simply swap the 2 for a 1 to setup basic auth for the root location.
336
+
this will setup basic-auth for the the `/about` location or simply swap the 2 for a 1 to setup basic auth for the root location.
336
337
337
338
338
339
339
340
## Built With
340
341
341
342
* [OpenResty](https://openresty.org/) - OpenResty (aka. ngx_openresty) is a full-fledged web
342
-
application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well
343
+
application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well
343
344
as most of their external dependencies.
344
345
* [Nginx](https://www.nginx.com/resources/wiki/) - The proxy server core software.
345
346
* [ngx_lua](http://wiki.nginx.org/HttpLuaModule) - Embed the power of Lua into Nginx
346
-
* [Naxsi](https://github.com/nbs-system/naxsi) - NAXSI is an open-source, high performance, low
347
-
rules maintenance WAF for NGINX
347
+
* [Naxsi](https://github.com/nbs-system/naxsi) - NAXSI is an open-source, high performance, low
348
+
rules maintenance WAF for NGINX
348
349
* [GeoLite data](http://www.maxmind.com">http://www.maxmind.com) This product includes GeoLite data created by MaxMind.
349
350
350
351
## Find Us
@@ -354,22 +355,22 @@ this will setup basic-auth for the the `/about` location or simply swap the 2 fo
354
355
355
356
## Contributing
356
357
357
-
Feel free to submit pull requests and issues. If it's a particularly large PR, you may wish to
358
+
Feel free to submit pull requests and issues. If it's a particularly large PR, you may wish to
358
359
discuss it in an issue first.
359
360
360
-
Please note that this project is released with a [Contributor Code of Conduct](code_of_conduct.md).
361
+
Please note that this project is released with a [Contributor Code of Conduct](code_of_conduct.md).
361
362
By participating in this project you agree to abide by its terms.
362
363
363
364
## Versioning
364
365
365
-
We use [SemVer](http://semver.org/) for the version tags available See the tags on this repository.
366
+
We use [SemVer](http://semver.org/) for the version tags available See the tags on this repository.
0 commit comments