Master Nginx Proxy Manager with Docker: Easy Setup, Static & Dynamic Proxies
Learn how to install and configure the visual Nginx management tool nginx‑proxy‑manager using Docker, set up static and dynamic proxy hosts, enable automatic SSL, and integrate it with a SpringBoot‑Vue e‑commerce project, complete with step‑by‑step commands and screenshots.
Introduction
nginx-proxy-manageris a visual Nginx management tool with over 25k stars on GitHub. It lets you create proxy hosts, obtain free SSL certificates automatically, and manage users without deep Nginx knowledge.
Features
Beautiful and secure user‑management interface.
Create proxy, redirect, and streaming rules without knowing Nginx.
Automatic free SSL certificate issuance and renewal.
Access Lists and Basic authentication for secure host access.
User, permission management and audit logging.
Installation
Using Docker to install nginx-proxy-manager is very convenient.
Pull the Docker image:
<code>docker pull jc21/nginx-proxy-manager:latest</code>Run the container:
<code>docker run -p 80:80 -p 81:81 -p 443:443 --name nginx-proxy-manager \
-v /mydata/nginx-pm/data:/data \
-v /mydata/nginx-pm/letsencrypt:/etc/letsencrypt \
-d jc21/nginx-proxy-manager:latest</code>After the container starts, open the management page at
http://<your‑ip>:81with the default credentials
[email protected]:changeme.
Static Proxy Example
Using the
malle‑commerce project as an example, modify your local
/etc/hostsfile:
<code>192.168.3.101 mall.macrozheng.com</code>Add a proxy host in the UI (Hosts → Proxy Hosts → Add Proxy Host) and configure the domain and target server in the Details tab.
In the Advanced tab, add a custom Nginx location block for static files:
<code>location /admin {<br/> alias /data/html/admin;<br/> index index.html index.htm;<br/>}</code>Upload the built admin frontend to
/mydata/nginx-pm/data/htmland access it at
http://mall.macrozheng.com/admin/.
For the frontend shop, add another location block:
<code>location /app {<br/> alias /data/html/app;<br/> index index.html index.htm;<br/>}</code>Now the shop is reachable at
http://mall.macrozheng.com/app/.
Dynamic Proxy Example
Modify
/etc/hostsfor the API domain:
<code>192.168.3.101 api.macrozheng.com</code>Add a new proxy host and set the hostname to
admin-api.macrozheng.com. The API is then accessible at
http://api.macrozheng.com/swagger-ui/.
Other Features
Enable SSL with automatic free certificate issuance.
Use Access Lists for Basic authentication on proxy hosts.
User Management for handling users and permissions.
Audit Log to view operation history.
Chinese Version
A Chinese‑localized image
nginx-proxy-manager-zhprovides the same functionality with translated UI. Run it with:
<code>docker run -p 80:80 -p 81:81 -p 443:443 --name nginx-proxy-manager \
-v /mydata/nginx-pm/data:/data \
-v /mydata/nginx-pm/letsencrypt:/etc/letsencrypt \
-d chishin/nginx-proxy-manager-zh:release</code>Conclusion
The visual Nginx Proxy Manager offers a clean interface and powerful features, allowing you to manage Nginx proxies, SSL certificates, and access controls without deep Nginx expertise.
Project Links
GitHub: https://github.com/NginxProxyManager/nginx-proxy-manager
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.