Description
nginx-proxy is an automated reverse proxy for Docker containers. It runs an nginx container alongside docker-gen, which generates nginx reverse proxy configuration from the containers running on the host and reloads nginx whenever containers start or stop, so you do not edit proxy config by hand. To route traffic to a container, you give it a VIRTUAL_HOST environment variable with the subdomain you want, and once DNS points that name at the host running nginx-proxy, requests for it reach the container. The proxied containers must expose the port to be proxied, through EXPOSE in the Dockerfile or the --expose flag, and must share at least one Docker network with the nginx-proxy container. Images come in three variants: a Debian-based image built on the nginx mainline image, an Alpine-based image with the -alpine suffix, and a dockergen image for use with the official nginx image in a separate-container setup. The README warns against using the latest, alpine or dockergen tags in production, because they follow the main branch and may break. Pin a specific version instead. Additional documentation is in the project's docs section.…
Highlights
- Automatic nginx config from running containers
- Routes by VIRTUAL_HOST subdomain
- Debian, Alpine and dockergen image variants
- Works with separate nginx containers
- Reloads when containers start or stop
Ratings & Reviews
No ratings yet
Be the first to rate nginx-proxy.
People also visit
nginx-proxy FAQ
What does nginx-proxy do?
It runs nginx with docker-gen, so nginx is reconfigured automatically when containers start or stop, and routes traffic to them by hostname.
How do I route a container?
Start the container with a VIRTUAL_HOST environment variable set to the subdomain you want, such as subdomain.yourdomain.com, and point DNS at the host.
What must the proxied container provide?
It must expose the port it serves, using EXPOSE in its Dockerfile or --expose, and share at least one Docker network with nginx-proxy.
Which image should I use?
There is a Debian-based image, an -alpine variant, and a -dockergen variant for setups with separate nginx containers.
Can I use the latest tag in production?
The README advises against it. The latest, alpine and dockergen tags follow the main branch, so pin a specific version.
Does it support port numbers in VIRTUAL_HOST?
No. The README says providing a port number in VIRTUAL_HOST is not supported.
What are the best nginx-proxy alternatives?
Popular alternatives to nginx-proxy include Nginx Proxy Manager, go-doxy and Godoxy. See all nginx-proxy alternatives

