π What is Nginx Proxy Manager?
The Nginx Proxy Manager (NPM) is an open source reverse proxy management tool based on the web server Nginx. It allows you to manage domains, SSL certificates, redirects, and more with an intuitive web UI instead of complicated Nginx configuration files, making it easy to use even for DevOps beginners!
—.
π Required Preparations
- install Docker & Docker Compose.
# Ubuntu example sudo apt update && sudo apt install docker.io docker-compose
- Own a domain (required for Let’s Encrypt SSL)
- open port 80/443 (allows HTTP/HTTPS traffic)
—]
π³ Create Docker Compose file
Create a docker-compose.yml
file and add the following content to it:
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
container_name: npm
restart: unless-stopped
ports:
- '80:80' # HTTP
- '443:443' # HTTPS
- '81:81' # Admin UI ports
volumes:
- ./data:/data # Configuration data.
- ./letsencrypt:/etc/letsencrypt # SSL certificate
environment:
DB_SQLITE_FILE: "/data/database.sqlite" # DB storage path.
DISABLE_IPV6: 'true' # Disable IPv6 (optional)
π Setting description.
- volumes:
./data
: NPM settings/DB storage path (create in current directory on host)./letsencrypt
: Let’s Encrypt certificate auto-save location
- ports:
81
: Admin web UI (http://μλ²IP:81)- 80/443`: Actual traffic handling port
—.
π Running and initializing the service
-
Run the container.
docker-compose up -d
-
access the web UI Open
http://:81
in a browser:bash docker-config up -d
3. β Initial account: admin@example.com / Password: changeme -
change your password Be sure to change it on your first login! (Settings β Users)
—]
π§ Reverse proxy setup example
**Hypothetical: expose your WordPress site (wordpress:80
) as blog.mydomain.com
- **Add Proxy Hosts
- Click `Hosts β Proxy Hosts β Add Proxy Host
- Set Domain & Target** Setup
Click on “`
π‘ Details tab
- Domain Names: blog.mydomain.com
- Scheme: http
- Forward Hostname/IP: wordpress (Container Name)
- Port: 80
- Apply SSL certificate.
π‘ SSL tab - SSL Certificate: Request a new SSL Certificate - Email: Your email - Force SSL βοΈ
β Let’s Encrypt will automatically issue the certificate!
—]
βοΈ How to utilize advanced features
1. Access Control (Access Lists) 1.
- IP whitelist/blacklist can be set
- Create in
Access → Access Lists
and connect to Proxy Host
2. Redirects
- Automatically switch
http://mydomain.com
βhttps://www.mydomain.com
π‘ Add Redirection Hosts - Source: mydomain.com - Target: https://www.mydomain.com
3. **Streaming support (WebSocket, etc.)
# Add to the Advanced tab
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
—]
π¨ Troubleshooting.
- 403 Forbidden: β Check target service’s firewall to allow NPM container IPs
- SSL Issuance Failed**:
β Verify that the domain DNS is resolved correctly to the server IP
β Check
./letsencrypt
volume permissions (chmod 755 letsencrypt
) - DB error:
# Regenerate data docker-compose down rm -rf data docker-compose up -d ```bash
—]
β Summarizing the benefits of NPM
Features | Benefits |
---|---|
πͺ Reverse Proxy | Manage multiple domains/services on one server |
π SSL automation | Free HTTPS with Let’s Encrypt |
π₯οΈ UI Management | No CLI required, beginner-friendly |
Monitoring Check traffic/error logs in real time |
—]
π― Closing thoughts
Nginx Proxy Manager is an innovative tool that simplifies complex Nginx configuration into a GUI. It can be deployed in 5 minutes with Docker Compose and supports free SSL auto-renewal, making it a must-have for running web services! Create a Docker Compose file today and open the world of reverse proxying β¨.
> π Official Documentation: nginxproxymanager.com > π¬ If you run into problems: GitHub Issues or utilizing the community is highly recommended! D