Ok, so I have 1 server with pfSense and many virtual servers. I'm using Nginx upstream functionality to run multiplies WEB servers on same public IP. Of course I need to know REAL users IP not Nginx proxy which is 192.168.2.2, but after switching to pfSense (recently had simple consumer router) web servers can't see real users IP.
I have tried to change various settings in System / Advanced / Firewall & NAT like:
NAT Reflection mode for port forwards
Enable automatic outbound NAT for Reflection
Also in Firewall / NAT / Outbound tried every mode, nothing helped still every user have IP of my Proxy server.
So how to disable masquarading, or how to pass real client IP.
**Update**
Ok, so it seams problem is with subdomains not domains. Situation now:
If client go to domain.com - everything is fine backend server can see real clinet IP
If client go to subdomain.domain.com - backend server see proxy server IP
All domains A records points to external IP, then pfSense forward 80 port to proxy, then proxy depending on domain forward to corresponding internal server.
I have 2 physical servers, 1 - pfSense router and another with virtualbox running many VM's in this example 4 VM's
Another one interesting thing, when i try to reach troublesome subdomain.domain1.com from inside local network I get this:
Again, no problems with domain1.com and domain2.com and so on...


Asked by RomkaLTU
(111 rep)
Aug 26, 2016, 05:10 PM
Last activity: Jun 20, 2025, 11:01 AM
Last activity: Jun 20, 2025, 11:01 AM