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 will then redirect all requests to a container where`VIRTUAL_HOST` is set to`DEFAULT_HOST`, if they don't match any (other)`VIRTUAL_HOST`. Using the example above requests without matching`VIRTUAL_HOST` will be redirected to a plain nginx instance after running the following command:
40
44
41
45
```console
42
-
docker run -d -e VIRTUAL_HOST=foo.bar.com nginx
46
+
docker run --detach \
47
+
--env VIRTUAL_HOST=foo.bar.com \
48
+
nginx
43
49
```
44
50
45
51
###Virtual Ports
@@ -179,7 +185,12 @@ If the application runs natively on this sub-path or has a setting to do so, `VI
179
185
If the requests are expected to not contain a sub-path and the generated links contain the sub-path, `VIRTUAL_DEST=/` should be used.
In this example, the incoming request `http://example.tld/app1/foo` will be proxied as `http://app1/foo` instead of `http://app1/app1/foo`.
@@ -221,7 +232,13 @@ Nginx variables such as `$scheme`, `$host`, and `$request_uri` can be used. Howe
221
232
If you want to use `nginx-proxy` with different external ports that the default ones of `80` for `HTTP` traffic and `443` for `HTTPS` traffic, you'll have to use the environment variable(s) `HTTP_PORT` and/or `HTTPS_PORT` in addition to the changes to the Docker port mapping. If you change the `HTTPS` port, the redirect for `HTTPS` traffic will also be configured to redirect to the custom port. Typical usage, here with the custom ports `1080` and `10443`:
@@ -231,8 +248,12 @@ With the addition of [overlay networking](https://docs.docker.com/engine/usergui
231
248
If you want your `nginx-proxy` container to be attached to a different network, you must pass the `--net=my-network` option in your `docker create` or `docker run` command. At the time of this writing, only a single network can be specified at container creation time. To attach to other networks, you can use the `docker network connect` command after your container is created:
232
249
233
250
```console
234
-
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro \
The contents of`/path/to/certs` should contain the certificates and private keys for any virtual hosts in use. The certificate and keys should be named after the virtual host with a`.crt` and`.key` extension. For example, a container with`VIRTUAL_HOST=foo.bar.com` should have a`foo.bar.com.crt` and`foo.bar.com.key` file in the certs directory.
@@ -445,7 +473,7 @@ In the separate container setup, no pre-generated key will be available and neit
445
473
Set`DHPARAM_SKIP` environment variable to`true` to disable using default Diffie-Hellman parameters. The default value is`false`.
446
474
447
475
```console
448
-
docker run -e DHPARAM_SKIP=true ....
476
+
docker run --env DHPARAM_SKIP=true ....
449
477
```
450
478
451
479
###Wildcard Certificates
@@ -661,7 +689,11 @@ IPv4 and IPv6 are never both used at the same time on containers that use both I
661
689
By default the nginx-proxy container will only listen on IPv4. To enable listening on IPv6 too, set the`ENABLE_IPV6` environment variable to`true`:
662
690
663
691
```console
664
-
docker run -d -p 80:80 -e ENABLE_IPV6=true -v /var/run/docker.sock:/tmp/docker.sock:ro nginxproxy/nginx-proxy
@@ -694,8 +726,11 @@ More reading on the potential TCP head-of-line blocking issue with HTTP/2: [HTTP
694
726
HTTP/3 use the QUIC protocol over UDP (unlike HTTP/1.1 and HTTP/2 which work over TCP), so if you want to use HTTP/3 you'll have to explicitely publish the 443/udp port of the proxy in addition to the 443/tcp port:
695
727
696
728
```console
697
-
docker run -d -p 80:80 -p 443:443/tcp -p 443:443/udp \