-
HI, I'm trying to get the actual remote IP address attached to the headers that my webserver is seeing. I'm new to all this and experimenting with a home lab to learn. My set up is as follows:
Here's an illustration: That all works fine and the websites listed as hosts in NPM are routed correctly to my various servers on my LAN. However, when I dump the headers from a web request at 192.168.2.90 I get the following: I do not have any advanced configurations set up on NPM (Edit Host->Advanced). It seems like NPM thinks the router is the 'real ip' address. What I would like to recover in the headers is the actual external IP address of the client making a request to the server. If I bypass NPM and directly forward 80 and 443 to the webserver at 192.168.2.90, then REMOTE_ADDR contains the correct external IP address that is making the request. Thus when the Router forwards the request to the forwarded port, the information is present. When I put NPM in the loop, that original REMOTE_ADDR information forwarded from the router is lost when the request gets rerouted by NPM. I would like the received header to either have REMOTE_ADDR or HTTP_X_REAL_IP be the correct external IP address. My guess is that this is something simple that I just don't understand yet about configuring NPM. Any help is appreciated. If this has been covered in some other post that I didn't find, please feel free to redirect me. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm a dope. I was testing from within the internal LAN. When I tested from an externally device with it's own IP address it works as expected. When I pinged my test script on the webserver from client on the external internet, the HTTP_X_REAL_IP was set correctly. When testing from machines on my internal LAN, the router was not passing my test machines IP address. |
Beta Was this translation helpful? Give feedback.
I'm a dope. I was testing from within the internal LAN. When I tested from an externally device with it's own IP address it works as expected.
When I pinged my test script on the webserver from client on the external internet, the HTTP_X_REAL_IP was set correctly. When testing from machines on my internal LAN, the router was not passing my test machines IP address.