[dancer-users] Client IP addr from behind a proxy
Mike Diehl
mdiehlenator at gmail.com
Tue Apr 7 14:04:54 UTC 2020
Hi all,
Fairly new user here...
I've got a server that sits on our LAN behind a SonicWall firewall. Our Dancer2 application
is running on port 8080 and is being reverse proxied by Apache.
Yuck, I know.
So, I'd like to get the actual client's IP address for logging purposes. To test that, I've got
these lines in my program:
session->write("CLIENT_IP", request->remote_address);
session->write("FORWARD_IP", request->header('x-forwarded-for'));
session->write("REAL_IP", request->header('x-real-ip'));
These tests were based on a few Google searches.
What I find in my session is: (sanitized)
CLIENT_IP: 127.0.0.1
FORWARD_IP: 98.101.x.y
REAL_IP: ~
However, my address is 10.2.1.219. The 98.101.x.y address is our outward facing IP
address on the SonicWall.
The Apache config resembles:
<Location "/Apps/">
ProxyPass "http://127.0.0.1:8080/Apps/"
</Location>
So, is what I'm wanting to do even possible in this configuration? If so, how?
Thanks in advance,
--
Mike Diehl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20200407/84965aaf/attachment.htm>
More information about the dancer-users
mailing list