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
nginx-proxy sets up a container running nginx and [docker-gen][1]. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
@@ -16,7 +16,7 @@ Then start any containers you want proxied with an env var `VIRTUAL_HOST=subdoma
16
16
17
17
$ docker run -e VIRTUAL_HOST=foo.bar.com ...
18
18
19
-
The containers being proxied must [expose](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) the port to be proxied, either by using the `EXPOSE` directive in their `Dockerfile` or by using the `--expose` flag to `docker run` or `docker create`.
19
+
The containers being proxied must [expose](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) the port to be proxied, either by using the `EXPOSE` directive in their `Dockerfile` or by using the `--expose` flag to `docker run` or `docker create` and be in the same network. By default, if you don't pass the --net flag when your nginx-proxy container is created, it will only be attached to the default bridge network. This means that it will not be able to connect to containers on networks other than bridge.
20
20
21
21
Provided your DNS is setup to forward foo.bar.com to the host running nginx-proxy, the request will be routed to a container with the VIRTUAL_HOST env var set.
22
22
@@ -133,7 +133,7 @@ If you would like to connect to FastCGI backend, set `VIRTUAL_PROTO=fastcgi` on
133
133
backend container. Your backend container should then listen on a port rather
134
134
than a socket and expose that port.
135
135
136
-
### FastCGI Filr Root Directory
136
+
### FastCGI File Root Directory
137
137
138
138
If you use fastcgi,you can set `VIRTUAL_ROOT=xxx` for your root directory
139
139
@@ -181,8 +181,12 @@ Finally, start your containers with `VIRTUAL_HOST` environment variables.
181
181
$ docker run -e VIRTUAL_HOST=foo.bar.com ...
182
182
### SSL Support using letsencrypt
183
183
184
-
[letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) is a lightweight companion container for the nginx-proxy. It allow the creation/renewal of Let's Encrypt certificates automatically.
184
+
[letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) is a lightweight companion container for the nginx-proxy. It allows the creation/renewal of Let's Encrypt certificates automatically.
185
185
186
+
Set `DHPARAM_GENERATION` environment variable to `false` to disabled Diffie-Hellman parameters completely. This will also ignore auto-generation made by `nginx-proxy`.
187
+
The default value is `true`
188
+
189
+
$ docker run -e DHPARAM_GENERATION=false ....
186
190
### SSL Support
187
191
188
192
SSL is supported using single host, wildcard and SNI certificates using naming conventions for
@@ -214,7 +218,7 @@ at startup. Since it can take minutes to generate a new `dhparam.pem`, it is do
214
218
background. Once generation is complete, the `dhparam.pem` is saved on a persistent volume and nginx
215
219
is reloaded. This generation process only occurs the first time you start `nginx-proxy`.
216
220
217
-
> COMPATIBILITY WARNING: The default generated `dhparam.pem` key is 2048 bits for A+ security. Some
221
+
> COMPATIBILITY WARNING: The default generated `dhparam.pem` key is 2048 bits for A+ security. Some
218
222
> older clients (like Java 6 and 7) do not support DH keys with over 1024 bits. In order to support these
219
223
> clients, you must either provide your own `dhparam.pem`, or tell `nginx-proxy` to generate a 1024-bit
220
224
> key on startup by passing `-e DHPARAM_BITS=1024`.
@@ -237,20 +241,27 @@ to identify the certificate to be used. For example, a certificate for `*.foo.c
237
241
could be named `shared.crt` and `shared.key`. A container running with `VIRTUAL_HOST=foo.bar.com`
238
242
and `CERT_NAME=shared` will then use this shared cert.
239
243
244
+
#### OCSP Stapling
245
+
To enable OCSP Stapling for a domain, `nginx-proxy` looks for a PEM certificate containing the trusted
246
+
CA certificate chain at `/etc/nginx/certs/<domain>.chain.pem`, where `<domain>` is the domain name in
247
+
the `VIRTUAL_HOST` directive. The format of this file is a concatenation of the public PEM CA
248
+
certificates starting with the intermediate CA most near the SSL certificate, down to the root CA. This is
249
+
often referred to as the "SSL Certificate Chain". If found, this filename is passed to the NGINX
The default SSL cipher configuration is based on the [Mozilla intermediate profile](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29) which
243
-
should provide compatibility with clients back to Firefox 1, Chrome 1, IE 7, Opera 5, Safari 1,
244
-
Windows XP IE8, Android 2.3, Java 7. Note that the DES-based TLS ciphers were removed for security.
245
-
The configuration also enables HSTS, PFS, OCSP stapling and SSL session caches. Currently TLS 1.0, 1.1 and 1.2
246
-
are supported. TLS 1.0 is deprecated but its end of life is not until June 30, 2018. It is being
247
-
included because the following browsers will stop working when it is removed: Chrome < 22, Firefox < 27,
The default SSL cipher configuration is based on the [Mozilla intermediate profile](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29) version 5.0 which
256
+
should provide compatibility with clients back to Firefox 27, Android 4.4.2, Chrome 31, Edge, IE 11 on Windows 7,
257
+
Java 8u31, OpenSSL 1.0.1, Opera 20, and Safari 9. Note that the DES-based TLS ciphers were removed for security.
258
+
The configuration also enables HSTS, PFS, OCSP stapling and SSL session caches. Currently TLS 1.2 and 1.3
259
+
are supported.
249
260
250
261
If you don't require backward compatibility, you can use the [Mozilla modern profile](https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility)
251
-
profile instead by including the environment variable `SSL_POLICY=Mozilla-Modern` to your container.
252
-
This profile is compatible with clients back to Firefox 27, Chrome 30, IE 11 on Windows 7,
253
-
Edge, Opera 17, Safari 9, Android 5.0, and Java 8.
262
+
profile instead by including the environment variable `SSL_POLICY=Mozilla-Modern` to the nginx-proxy container or to your container.
263
+
This profile is compatible with clients back to Firefox 63, Android 10.0, Chrome 70, Edge 75, Java 11,
264
+
OpenSSL 1.1.1, Opera 57, and Safari 12.1. Note that this profile is **not** compatible with any version of Internet Explorer.
254
265
255
266
Other policies available through the `SSL_POLICY` environment variable are [`Mozilla-Old`](https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility)
256
267
and the [AWS ELB Security Policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-policy-table.html)
@@ -273,12 +284,12 @@ a 500.
273
284
274
285
To serve traffic in both SSL and non-SSL modes without redirecting to SSL, you can include the
275
286
environment variable `HTTPS_METHOD=noredirect` (the default is `HTTPS_METHOD=redirect`). You can also
276
-
disable the non-SSL site entirely with `HTTPS_METHOD=nohttp`, or disable the HTTPS site with
277
-
`HTTPS_METHOD=nohttps`. `HTTPS_METHOD` must be specified on each container for which you want to
278
-
override the default behavior. If `HTTPS_METHOD=noredirect` is used, Strict Transport Security (HSTS)
279
-
is disabled to prevent HTTPS users from being redirected by the client. If you cannot get to the HTTP
280
-
site after changing this setting, your browser has probably cached the HSTS policy and is automatically
281
-
redirecting you back to HTTPS. You will need to clear your browser's HSTS cache or use an incognito
287
+
disable the non-SSL site entirely with `HTTPS_METHOD=nohttp`, or disable the HTTPS site with
288
+
`HTTPS_METHOD=nohttps`. `HTTPS_METHOD` must be specified on each container for which you want to
289
+
override the default behavior. If `HTTPS_METHOD=noredirect` is used, Strict Transport Security (HSTS)
290
+
is disabled to prevent HTTPS users from being redirected by the client. If you cannot get to the HTTP
291
+
site after changing this setting, your browser has probably cached the HSTS policy and is automatically
292
+
redirecting you back to HTTPS. You will need to clear your browser's HSTS cache or use an incognito
282
293
window / different browser.
283
294
284
295
By default, [HTTP Strict Transport Security (HSTS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security)
@@ -401,7 +412,7 @@ Before submitting pull requests or issues, please check github to make sure an e
401
412
To run tests, you need to prepare the docker image to test which must be tagged `jwilder/nginx-proxy:test`:
0 commit comments