Merge pull request #1 from appropriate/overlay-support
Update README wording for overlay networking
This commit is contained in:
commit
9341f54e51
1 changed files with 8 additions and 8 deletions
16
README.md
16
README.md
|
@ -35,17 +35,18 @@ You can also use wildcards at the beginning and the end of host name, like `*.ba
|
||||||
|
|
||||||
### Multiple Networks
|
### Multiple Networks
|
||||||
|
|
||||||
With the new overlay network, your proxy can be deal with many containers in many networks. Default, if you don't use ```--net``` flag, your proxy will be attached at ```bridge``` default network. You can define your container with ```--net=your_network``` option.
|
With the addition of [overlay networking](https://docs.docker.com/engine/userguide/networking/get-started-overlay/) in Docker 1.9, your `nginx-proxy` container may need to connect to backend containers on multiple networks. 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`.
|
||||||
|
|
||||||
If your proxy try to access at a container in an unattached network, the request is successful.
|
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:
|
||||||
|
|
||||||
#### Connect Another Network
|
```console
|
||||||
|
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro \
|
||||||
In current Docker release (1.9), you can create a container with only one network. To attach others networks, you can use this command.
|
--name my-nginx-proxy --net my-network jwilder/nginx-proxy
|
||||||
```
|
$ docker network connect my-other-network my-nginx-proxy
|
||||||
docker network connect my_network my_container
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In this example, the `my-nginx-proxy` container will be connected to `my-network` and `my-other-network` and will be able to proxy to other containers attached to those networks.
|
||||||
|
|
||||||
### SSL Backends
|
### SSL Backends
|
||||||
|
|
||||||
If you would like to connect to your backend using HTTPS instead of HTTP, set `VIRTUAL_PROTO=https` on the backend container.
|
If you would like to connect to your backend using HTTPS instead of HTTP, set `VIRTUAL_PROTO=https` on the backend container.
|
||||||
|
@ -75,7 +76,6 @@ Then start the docker-gen container with the shared volume and template:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run --volumes-from nginx \
|
$ docker run --volumes-from nginx \
|
||||||
\
|
|
||||||
-v /var/run/docker.sock:/tmp/docker.sock:ro \
|
-v /var/run/docker.sock:/tmp/docker.sock:ro \
|
||||||
-v $(pwd):/etc/docker-gen/templates \
|
-v $(pwd):/etc/docker-gen/templates \
|
||||||
-t jwilder/docker-gen -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
|
-t jwilder/docker-gen -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
|
||||||
|
|
Reference in a new issue