Publish: 2023-06-30 | Modify: 2023-06-30
To facilitate public access to domain names and support HTTPS in an intranet environment with multiple different web services, a common practice is to set up an Nginx service as a reverse proxy in the intranet, which centralizes services, enables domain name access, and deploys SSL certificates.
However, manually configuring Nginx can be troublesome, error-prone, and not very beginner-friendly. But with Nginx Proxy Manager, this problem can be easily solved.
Nginx Proxy Manager is a lightweight, high-performance web proxy (including reverse proxy) and email proxy based on Docker. It has a user-friendly interface that makes it easy to create and manage Nginx proxy hosts.
Its features include:
In summary, Nginx Proxy Manager is a powerful tool that makes managing Nginx reverse proxies easier, especially for users who are not familiar with Nginx configuration files.
First, make sure you have Docker-Compose installed, then create a directory to save Nginx Proxy Manager data:
# Create a directory
mkdir nginx
# Enter the directory
cd nginx
In the newly created directory, create a file named docker-compose.yaml
and copy the following content into it:
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '880:80'
- '81:81'
- '8443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
880
is the HTTP port of Nginx, you can modify it according to your own situation.8443
is the HTTPS port of Nginx, you can modify it according to your own situation.81
is the port for the Nginx Proxy Manager management interface.Then use the command docker-compose up -d
to start Nginx Proxy Manager. After it starts successfully, enter http://IP:81
to open the Nginx Proxy Manager visual (web) interface.
[email protected]
changeme
The first time you use it, you will be prompted to modify the email, password, and other information. Please follow the prompts to complete the modification.
Open the navigation bar and go to "Hosts - Proxy Hosts - Add Proxy Host", enter your domain name and the target protocol + target IP + target port for reverse proxy, and then click SAVE to save.
Then, resolve your domain name to the IP address where Nginx Proxy Manager is located, so that you can access it through http://your-domain:880
(Note: I used port 880 for HTTP above).
Nginx Proxy Manager comes with a default "Let's Encrypt" SSL certificate, but it may not work in China due to the Great Firewall. However, Nginx Proxy Manager also supports adding custom SSL certificates.
Open the navigation bar and go to "SSL Certificates - Add SSL Certificate - Custom".
Follow the instructions to fill in the SSL certificate name and select the private key file and certificate file, then click SAVE to save.
Go back to "Proxy Hosts", find the domain name you added earlier, and then modify it. Switch to the "SSL" tab, select the custom SSL certificate you just added, and click save.
After deployment, access it again with the HTTPS protocol, and if you are using a non-standard port (not 443), you need to include the port in the URL, for example: https://your-domain:8443
.
Since it is deployed using Docker-Compose, upgrading Nginx Proxy Manager to a new version is also very simple. Just execute the following command:
# Pull the new image
docker-compose pull
# Restart Nginx Proxy Manager
docker-compose up -d
In addition to the basic features mentioned above, Nginx Proxy Manager also supports some other features, such as:
These can all be done directly through the web interface, which is very convenient. If you are interested, you can explore them on your own.
Nginx Proxy Manager is highly suitable for NAS users. With Nginx Proxy Manager, configuring Nginx reverse proxies becomes easier, and both beginners and experienced users can benefit from the web interface, which improves efficiency.
Nginx Proxy Manager official website: https://nginxproxymanager.com/
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.