Public | Automated Build

Last pushed: 2 years ago
Short Description
Automated Nginx reverse proxy for docker containers. With dynamic default-vhost setting.
Full Description

nginx-proxy sets up a container running nginx and docker-gen. docker-gen generate reverse proxy configs for nginx and reloads nginx when containers they are started and stopped.

See Automated Nginx Reverse Proxy for Docker for why you might want to use this.

This fork is from jwilder/nginx-proxy.


To run it:

$ docker run -d --name=proxy --privileged=true -p 80:80 -e -v /var/run/docker.sock:/var/run/docker.sock  mingzeke/nginx-proxy

For SSL support

$ docker run -d --name=proxy --privileged=true -p 80:80 -p 443:443 -e -e DEFAULT_SSL=TRUE -v /path/to/certs/folder:/certs -v /var/run/docker.sock:/var/run/docker.sock  mingzeke/nginx-proxy

Then start any containers you want proxied with an env var

$ docker run -e  ...

For SSL support add -e SSL=TRUE and place the crt and key file into the /certs folder of the nginx-proxy volume (/certs).

Provided your DNS is setup to forward to the a host running nginx-proxy, the request will be routed to a container with the VIRTUAL_HOST env var set.

Set Default Virtual Host

$ docker exec -ti proxy default-vhost $ip $host

Multiple Ports

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. This is not working for ssl for now.

Multiple Hosts

If you need to support multipe virtual hosts for a container, you can separate each enty with commas. For example,,, and each host will be setup the same.

Docker Pull Command
Source Repository