# nginx-proxy

nginx-proxy is a self-hosted network services app. Automated Nginx Reverse Proxy for Docker

Canonical page: https://ourlocalhost.com/app/7870/nginx-proxy

## Description

Automated Nginx Reverse Proxy for Docker

## Platform availability

Available on 1 of 10 platforms: Any server.

## Health score

81/100 (Excellent), based on 5 of 5 factors.
- Maintained: 100 (last commit 3 days ago)
- Popular: 86 (19,949 GitHub stars)
- Easy to install: 25 (1 install platform, install notes)
- Light to run: 100 (134 MB minimum RAM)
- Security check: 77 (no serious findings, CI, tests, OpenSSF Scorecard 4.9/10)

## Links

- GitHub: https://github.com/nginx-proxy/nginx-proxy

## Common questions

### How do I get a container proxied by nginx-proxy?

Set the environment variable VIRTUAL_HOST=subdomain.yourdomain.com on the container you want proxied, and make sure DNS resolves that hostname to the host running nginx-proxy. The container must also expose the port to be proxied via EXPOSE or --expose.

### Why can't nginx-proxy reach my other containers?

Proxied containers must share at least one Docker network with the nginx-proxy container. If no --net flag is used, nginx-proxy only attaches to the default bridge network and cannot connect to containers on other networks.

### Can I include a port number in the VIRTUAL_HOST variable?

No, providing a port number in VIRTUAL_HOST is not supported. Use the virtual ports or custom external HTTP/HTTPS ports configuration options depending on what you want to achieve.

### Which image variants are available?

There is a Debian-based image (nginxproxy/nginx-proxy) and an Alpine-based variant with the -alpine suffix. There is also a -dockergen variant meant for a separate-containers setup with the official nginx image.

### How does nginx-proxy detect when containers start and stop?

It runs nginx together with docker-gen, which watches Docker events, generates reverse proxy configs automatically, and reloads nginx when containers are started or stopped.

### Do I need to expose any volumes or ports for nginx-proxy to work?

Yes, publish port 80 and mount the Docker socket read-only, for example with --publish 80:80 and --volume /var/run/docker.sock:/tmp/docker.sock:ro.

## Alternatives

- Envoy: Envoy is an open-source cloud-native edge, middle, and service proxy for managing, routing, and securing traffic in microservice architectu…
- Haproxy: HAProxy is a TCP proxy and a HTTP reverse proxy.

---
Source: Our Local Host (https://ourlocalhost.com/app/7870/nginx-proxy), the self-hosted and open-source app directory.
