Title: Solving Real IP Address Visibility Behind NGINX Proxy Manager in Synology DSM
Introduction
In this article, we will discuss how to make the real IP address of visitors visible behind the NGINX Proxy Manager in Synology DSM. This issue occurs when the NGINX Proxy Manager receives a request from a client, and the client's IP address is not passed to the server.
Prerequisites
- A Synology NAS running DSM (DiskStation Manager)
- NGINX Proxy Manager installed and configured
- Basic understanding of networking and Synology DSM
Steps to Make Real IP Address Visible
-
Access NGINX Proxy Manager
Log in to your Synology NAS, navigate to the Control Panel, and find the NGINX Proxy Manager. Click on it to open.
-
Edit the NGINX Configuration
In the NGINX Proxy Manager dashboard, click on the
Configurebutton. This will open the NGINX configuration file in a text editor. -
Add the Real IP Module
Search for the
httpblock in the configuration file. Inside this block, add the following lines to enable the real IP module:http { # ... other directives ... real_ip_header X-Forwarded-For; real_ip_trusted_forward_headers X-Forwarded-For; }Save and close the file.
-
Reload NGINX Configuration
After saving the changes, reload the NGINX configuration to apply the changes:
- Click on the
Save and Testbutton. If there are no errors, click onApply Configuration. - Alternatively, you can reload the configuration manually by going to the
Systemtab, clicking onNGINX, and then clicking onReload Configuration.
- Click on the
-
Test the Changes
Now, when a visitor accesses your website, the real IP address should be visible in the server logs. You can check the logs to confirm the changes have taken effect.
References
Summary
In this article, we learned how to make the real IP address of visitors visible behind the NGINX Proxy Manager in Synology DSM. We achieved this by enabling the real IP module in the NGINX configuration and reloading the configuration. This allows the server to see the real IP address of the visitors, even when they are behind a proxy.