Nginx Proxy Manager Setup: Web-Based Reverse Proxy
Nginx Proxy Manager Docker installation, automatic SSL certificate renewal, proxy host configuration, access lists, redirects, streams and custom locations.
Table of Contents
Nginx Proxy Manager Setup: Web-Based Reverse Proxy
Nginx Proxy Manager (NPM) is an open-source tool that allows you to manage Nginx reverse proxy through a user-friendly web interface. You can handle SSL certificate management, proxy host configuration, and access control without needing the command line.
What is Nginx Proxy Manager?
Key features of Nginx Proxy Manager:
- Web Interface: Easy-to-use management panel
- Automatic SSL Renewal: Free SSL with Let's Encrypt integration
- Proxy Hosts: Reverse proxy configuration
- Redirection Hosts: URL redirections
- Stream Hosts: TCP/UDP port forwarding
- Access Lists: IP and user-based access control
- Custom Locations: Custom Nginx location blocks
- 404 Hosts: Custom 404 pages
Docker Installation
Docker Compose Configuration
# docker-compose.yml
version: '3.8'
services:
npm:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
- '80:80' # HTTP
- '443:443' # HTTPS
- '81:81' # Admin Panel
volumes:
- npm_data:/data
- npm_letsencrypt:/etc/letsencrypt
environment:
- TZ=Europe/Istanbul
volumes:
npm_data:
npm_letsencrypt:
# Start installation
docker compose up -d
# Check container status
docker ps | grep nginx-proxy-manager
First Login
Access the admin panel after installation:
http://SERVER_IP:81
Default credentials:
Email: admin@example.com
Password: changeme
You will be prompted to change your password and email on first login.
Adding Proxy Hosts
Basic Proxy Host
To put a web application behind a reverse proxy:
- Proxy Hosts → Add Proxy Host
- Domain Names:
app.example.com - Scheme:
http - Forward Hostname / IP:
192.168.1.10(or container name) - Forward Port:
3000 - Block Common Exploits: Enable
- Websockets Support: Enable for WebSocket applications
Adding SSL Certificate
In the SSL tab when creating a proxy host:
- SSL Certificate: Request a new SSL Certificate
- Force SSL: Enable (HTTP → HTTPS redirect)
- HTTP/2 Support: Enable
- HSTS Enabled: Enable
- Email Address: Email for SSL notifications
- I Agree: Accept Let's Encrypt terms
- Save
The SSL certificate will be automatically obtained and renewed.
Proxy with Docker Network
Use the same network to proxy Docker containers:
# docker-compose.yml
version: '3.8'
services:
npm:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
- '80:80'
- '443:443'
- '81:81'
volumes:
- npm_data:/data
- npm_letsencrypt:/etc/letsencrypt
networks:
- proxy_network
webapp:
image: your-webapp:latest
container_name: webapp
restart: unless-stopped
expose:
- "3000"
networks:
- proxy_network
networks:
proxy_network:
driver: bridge
volumes:
npm_data:
npm_letsencrypt:
Use the container name as Forward Hostname in the proxy host:
- webapp →
webapp:3000
Access Lists
Restrict access to specific IPs or users:
IP-Based Access Control
- Access Lists → Add Access List
- Name:
Admin Only - Satisfy Any: Any condition is sufficient
In the Access tab:
Allow: 192.168.1.0/24
Allow: 10.0.0.0/8
Deny: all
HTTP Basic Authentication
In the Authorization tab:
Username: admin
Password: StrongPassword123!
Assign the access list to a proxy host: Proxy Host → Edit → Access List → Select Admin Only.
Redirection Host
To create URL redirections:
- Redirection Hosts → Add Redirection Host
- Domain Names:
old.example.com - Scheme:
https - Forward Domain:
new.example.com - HTTP Code:
301(Permanent redirect) - Preserve Path: Keep URL path
Stream Host (TCP/UDP Proxy)
To forward TCP or UDP ports:
- Streams → Add Stream
- Incoming Port:
25565(e.g., Minecraft) - Forward Host:
192.168.1.50 - Forward Port:
25565 - TCP Forwarding: Enable
Example use cases:
- Minecraft server: TCP 25565
- FiveM server: TCP/UDP 30120
- Database: TCP 3306 (MySQL), TCP 5432 (PostgreSQL)
Custom Nginx Configuration
Advanced Tab
In the Advanced tab when editing a proxy host:
# Custom headers
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Large file uploads
client_max_body_size 100M;
# Timeout settings
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Custom Location
To route different paths to different backends within a proxy host:
- Proxy Host → Edit → Custom Locations
- Location:
/api - Scheme:
http - Forward Hostname:
api-server - Forward Port:
8080
Wildcard SSL Certificate
To obtain a wildcard certificate with DNS Challenge:
- SSL Certificates → Add SSL Certificate
- Let's Encrypt tab
- Domain Names:
*.example.com - Use a DNS Challenge: Enable
- DNS Provider: Cloudflare, DigitalOcean, etc.
- Credentials: Enter API token
Backup and Restore
# Backup NPM data
docker exec nginx-proxy-manager tar -czf /tmp/npm-backup.tar.gz /data /etc/letsencrypt
docker cp nginx-proxy-manager:/tmp/npm-backup.tar.gz ./npm-backup-$(date +%Y%m%d).tar.gz
# Restore
docker cp ./npm-backup.tar.gz nginx-proxy-manager:/tmp/
docker exec nginx-proxy-manager tar -xzf /tmp/npm-backup.tar.gz -C /
docker restart nginx-proxy-manager
Update
docker compose pull
docker compose up -d
docker image prune -f
Security Recommendations
# Make admin panel accessible only from specific IPs
ports:
- '80:80'
- '443:443'
- '127.0.0.1:81:81' # Localhost only
# Access via SSH tunnel
ssh -L 81:localhost:81 user@server-ip
# In browser: http://localhost:81
With Nginx Proxy Manager on your REXE servers, you can manage all your web applications from a single point, automatically obtain and renew SSL certificates. The web interface lets you set up professional reverse proxy without dealing with Nginx configuration files.
Related Articles
Server Monitoring Tools: Grafana, Prometheus and Netdata
Prometheus + Grafana stack setup, Netdata, node_exporter, alert rules, dashboard creation and server metric monitoring.
Proxy Server Setup: Squid and HAProxy Guide
Squid forward proxy, HAProxy load balancer, SSL termination, ACL rules, caching, health checks and high availability.
CrowdSec Setup: Community-Driven Security Engine
CrowdSec installation, bouncer configuration, attack detection, IP blocking, dashboard, collection and scenario management.