
nginx-proxy
Runs nginx in Docker and auto-configures it to route web traffic to your other containers.
- Stars
- 19.9k
- Forks
- 3k
- Licence
- MIT
- Language
- Python
- Last update
- 4 days ago
- Type
- Dev tool
What it is
nginx-proxy is a Docker container that runs nginx alongside docker-gen. docker-gen watches for containers starting and stopping, writes reverse proxy configs for nginx, and reloads nginx, so you can host several web apps behind one entry point without editing nginx config by hand. You route traffic by setting a VIRTUAL_HOST environment variable on each app's container. The README describes it as officially maintained by ZeroSSL.
- Route foo.bar.com to one container and another domain to a second container on the same host
- Run multiple proxied apps on port 80 with a single nginx-proxy container
- Use separate containers setup with the -dockergen image alongside the official nginx image
Great for
- People running several web apps on one Docker host who want one public port 80 entry point
- Developers who want new containers picked up automatically without manual nginx edits
- Self-hosters who already use Docker and understand DNS pointing a domain at a server
Not ideal for
- People not using Docker, since the project is built around Docker containers and the Docker socket
- Teams that need a fully hand-tuned nginx setup, because configs are generated automatically
- Anyone wanting production use with the latest tag, since the README explicitly advises against it
How to get it
- 1
Run with Docker
You'll need: Docker
Start nginx-proxy with Docker (pinned to 1.11 tag)
docker run --detach \ --name nginx-proxy \ --publish 80:80 \ --volume /var/run/docker.sock:/tmp/docker.sock:ro \ nginxproxy/nginx-proxy:1.11 - 2
Run it
- Start the nginx-proxy container with the docker run command from the README, publishing port 80.
- Start any container you want proxied and set the environment variable VIRTUAL_HOST to your domain, for example foo.bar.com.
- Point your DNS for that domain at the host running nginx-proxy.
- Open http://foo.bar.com in a browser to confirm the request reaches your container.
- 3
Get the most out of it
- Pin an explicit version tag such as 1.11 rather than latest, as the README recommends for production
- Use the -alpine variant if you want the Alpine-based image instead of Debian slim
- Use the -dockergen variant for the separate containers setup with the official nginx image
- See the project docs section for virtual ports and custom external HTTP/HTTPS ports
Downloads
Strengths
- Proxied containers only need an environment variable to be routed, with no manual nginx config
- Provides Debian, Alpine and dockergen image variants to fit different setups
- Clear README warning about pinning versions for stable production use
Trade-offs
- Requires read access to the Docker socket, which is a security-sensitive setup to understand
- Proxied containers must expose ports and share a Docker network with the proxy, or routing fails
- Port numbers in VIRTUAL_HOST are not supported, so extra configuration is needed for custom ports
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| nginx-proxy (this) | 19.9k | Dev tool | intermediate | 4 days ago | People running several web apps on one Docker host who want one public port 80 entry point |
| traefik | 65.4k | App | intermediate | 4 days ago | Teams running many microservices in Docker, Swarm, or Kubernetes |
| nginx-proxy-manager | 34.6k | App | beginner | 5 days ago | People self-hosting web services at home who want friendly domain names and HTTPS |
| windows | 54k | Dev tool | intermediate | 29 days ago | People who need a Windows environment on a Linux server or PC without installing Windows directly |
| colima | 31.5k | Dev tool | beginner | 23 days ago | Mac developers who want Docker containers without Docker Desktop |
| ProxmoxVE | 30k | Dev tool | beginner | 4 days ago | Homelab users who run Proxmox VE and want quick installs of common self-hosted services |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.