Skip to content

Commit 9341f54

Browse files
Merge pull request #1 from appropriate/overlay-support
Update README wording for overlay networking
2 parents 2eb9775 + 5c828cb commit 9341f54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,18 @@ You can also use wildcards at the beginning and the end of host name, like `*.ba
3535

3636
### Multiple Networks
3737

38-
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.
38+
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`.
3939

40-
If your proxy try to access at a container in an unattached network, the request is successful.
40+
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:
4141

42-
#### Connect Another Network
43-
44-
In current Docker release (1.9), you can create a container with only one network. To attach others networks, you can use this command.
45-
```
46-
docker network connect my_network my_container
42+
```console
43+
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro \
44+
--name my-nginx-proxy --net my-network jwilder/nginx-proxy
45+
$ docker network connect my-other-network my-nginx-proxy
4746
```
4847

48+
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.
49+
4950
### SSL Backends
5051

5152
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:
7576

7677
```
7778
$ docker run --volumes-from nginx \
78-
\
7979
-v /var/run/docker.sock:/tmp/docker.sock:ro \
8080
-v $(pwd):/etc/docker-gen/templates \
8181
-t jwilder/docker-gen -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf

0 commit comments

Comments
 (0)