Greetings,
I'm using OpenWRT 24.10 and my network LAN is: 192.168.1.1 (OpenWRT) ---> PC (192.168.1.19)
I successfully port forwarded OpenWRT's 443 port to PC's 443 and all seems working fine except that Nginx (which is running on that PC) detects all HTTP(S) requests as "originated from 192.168.1.1" and not from the real external client's IP.
I would like to setup some Nginx rules based on Internal or External IP, but if all requests has OpenWRT (192.168.1.1) as origin, it's not possible to do that.
On "Port forwarding" page --> "443" rule --> "Advanced settings" tab I already enabled:
"Enable NAT loopback"
Loopback source IP: "use external IP address"
I don't have any other NAT, firewall or strange settings: it's just OpenWRT default installation with only port 80 and 443 forwarded to that PC.
It seems not possible to let Nginx (installed on PC) see the real client's external IP......
Well, I said the reason: I would like to setup some Nginx rule based on internal or external client's IP.
I.e:
to display basic Authorization modal when a specific Domain/page is requested
to denied a Domain/page request if the Client is External
I'm currently out of home but if I read Nginx logs while I'm surfing my PC's webpages then all requests seems originated from INSIDE my LAN and not from external.
At work (where I'm now), using Cisco router and firewalls, if someone points to our public IP at a specific port then the HTTP(S) request is port forwarded to my PC and my Nginx (installed on my working PC) sees correctly the external IP and not our router's one.
incredible, that's the solution!!
Now the Client IP detected by Nginx is the external one.
Thx!
(I don't know why it but I suppose it was set by default after OpenWRT installation.....but if you asked it to me then I may have set it incorrectly during one of my tries)