I’m opening this post because I’m encountering a small, non-blocking but nonetheless annoying problem for which I can’t find a solution.
I’m using Nginx Proxy Manager on the front end, which manages all the redirections from my home network to various machines.
Behind this machine, I’ve installed HestiaCP, which hosts my personal websites.
Everything works perfectly: Nginx Proxy Manager handles redirects and Let’s Encrypt certificates just fine.
The problem is that I can’t get the public IP of the clients accessing my websites.
In the Awstats logs (or the Nginx logs behind it), I only see the local IP address of my Nginx Proxy Manager (192.168.X.X), and not that of the actual visitors.
Could you give me an idea?
I’ve scoured the forum, but I can’t find any topic that might help me…
I’ve never used Nginx Proxy Manager, but you could try the same approach Hestia uses to retrieve the real IP from Cloudflare connections. Hestia adds the following configuration to Nginx:
If your Nginx Proxy Manager can add a header (such as X-Real-IP) containing the real IP address, you can create a configuration file like the following. Assume 192.168.1.2 is the IP address of your NPM:
You should disable the cloudflare.inc file, as Nginx can use only one real_ip_header directive. While it’s technically possible to add more, it requires the headers_more module, which would mean compiling Nginx yourself.
As I mentioned, I haven’t tested this setup personally, but it might be worth trying.