Nginx Proxy Manager: Port Forwarding Guide
A step-by-step guide to configuring port forwarding for Nginx Proxy Manager (NPM) on both a generic ISP router and a pfSense firewall. Correctly forwarding ports 80 (HTTP) and 443 (HTTPS) is essential for NPM to function correctly and for obtaining SSL certificates.
Step 1: Introduction to Port Forwarding
Port forwarding redirects network traffic from your public IP to a specific device on your local network. For Nginx Proxy Manager (NPM) to work, you must forward all incoming web traffic on ports 80 and 443 to your NPM server's internal IP.
Step 2: Find Your NPM Server's Internal IP
First, find the local IP address of the machine running NPM. This is the destination for your port forwarding rules. On Linux, run `ip addr`. On Windows, use `ipconfig`. Look for the address next to `inet` or `IPv4 Address`.
Step 3: Option 1: Generic ISP Router
Log in to your router's administration page (usually `192.168.1.1` or `192.168.0.1`). Navigate to the Port Forwarding or Firewall settings. You will need to create two separate rules, one for each port.
Step 4: Create the HTTP Rule
For the first rule (HTTP), set the External Port to 80 and the Internal Port to 80. The Protocol should be TCP. The Internal/Local IP is the address of your NPM server that you found in Step 2.
Step 5: Create the HTTPS Rule
For the second rule (HTTPS), set the External Port to 443 and the Internal Port to 443. The Protocol should be TCP. The Internal/Local IP is again the address of your NPM server. Save both rules to apply them.
Step 6: Option 2: pfSense Firewall
pfSense provides more detailed control. Go to `Firewall > NAT > Port Forward` and click 'Add' to create a new rule. The configuration is similar but with more specific fields.
Step 7: Configure the HTTP Rule in pfSense
Set Interface to WAN, Protocol to TCP, and Destination to WAN Address. For Destination port range, select HTTP (80) to HTTP (80). Redirect target IP should be your NPM server's IP, and Redirect target port should be HTTP (80).
Step 8: Configure the HTTPS Rule and Apply
Repeat the previous step for the HTTPS rule. Set the Destination port range to HTTPS (443) to HTTPS (443) and the Redirect target port to HTTPS (443). Finally, click `Save` and then `Apply Changes` to activate the rules.
Step 9: Verify the Port Forwarding
To confirm your ports are open, use an online port checker tool. Enter your public IP address and check for ports 80 and 443. A successful check indicates that traffic is now properly being forwarded to your NPM server.