Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pini-gh committed Apr 7, 2021
1 parent 5163c9b commit f07d069
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,26 @@ You can activate the IPv6 support for the nginx-proxy container by passing the v

$ docker run -d -p 80:80 -e ENABLE_IPV6=true -v /var/run/docker.sock:/tmp/docker.sock:ro pinidh/nginx-proxy

### Multiple Ports
### Multiple Hosts

If your container exposes multiple ports, nginx-proxy will default to the service running on port 80. If you need to specify a different port, you can set a VIRTUAL_PORT env var to select a different one. If your container only exposes one port and it has a VIRTUAL_HOST env var set, that port will be selected.
If you need to support multiple virtual hosts for a container, you can separate each entry with commas. For example, `foo.bar.com,baz.bar.com,bar.com` and each host will be setup the same.

[1]: https://github.com/jwilder/docker-gen
[2]: http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/
### Virtual Ports

### Multiple Hosts
When your container exposes only one port, nginx-proxy will default to this port, else to port 80.

If you need to support multiple virtual hosts for a container, you can separate each entry with commas. For example, `foo.bar.com,baz.bar.com,bar.com` and each host will be setup the same.
If you need to specify a different port, you can set a `VIRTUAL_PORT` env var to select a different one. This variable cannot be set to more than one port.

If you need to specify a different port for each virtual host, use this syntax for the `VIRTUAL_HOST` variable:
```
VIRTUAL_HOST=host1:port1,host2:port2,...
```

For each host defined into `VIRTUAL_HOST`, the associated virtual port is retrieved by order of precedence:
1. From the `host:port` syntax in the `VIRTUAL_HOST` definition
1. From the `VIRTUAL_PORT` environment variable
1. From the container's exposed port if there is only one
1. From the default port 80 when none of the above methods apply

### Wildcard Hosts

Expand Down

0 comments on commit f07d069

Please sign in to comment.