jwildernginx-proxy | docker nginx ssl
nginx-proxysetsupacontainerrunningnginxanddocker-gen[1].docker-gengeneratesreverseproxyconfigsfornginxandreloadsnginxwhencontainersarestartedandstopped.SeeAutomatedNginxReverseProxyforDocker[2]forwhyyoumightwanttousethis.UsageTorunit:$dockerrun-d-p80:80-v/var/run/docker.sock:/tmp/docker.sock:rojwilder/nginx-proxyThenstartanycontainersyouwantproxiedwithanenvvarVIRTUAL_HOST=subdomain.youdomain.com$dockerrun-eVIRTUAL_HOST=foo.bar.com...Thecontainersbeingproxiedmustexpose[3]theporttobeproxied,ei...
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.
See Automated Nginx Reverse Proxy for Docker[2] for why you might want to use this.
UsageTo run it:
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxyThen start any containers you want proxied with an env var VIRTUAL_HOST=subdomain.youdomain.com
$ docker run -e VIRTUAL_HOST=foo.bar.com ...The containers being proxied must expose[3] 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 dont 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 br...