HAProxy How to get the user real IP address
-
Hi,
We have several web servers as backend to the HAProxy (http & https). What we need for web statistics is the real IP of the visitors and not the HAproxy IP address which is being recorded. How can I change the HAProxy configuration so that the IIS and Apache logs show the real IP of the users visiting the web sites.
Thanks
cjb
-
Hi,
There are a few ways to do that..
https://gist.github.com/PiBa-NL/d826e0d6b35bbe4a5fc3#file-haproxy-sending-the-source-ip-to-the-webserver
Options 1 and 3 are available in the webgui as a 'checkbox'.
Option 2 can be set as textual in advanced option.Ill add that to my wiki shortly..
Regards,
PiBa-NLEdit:
Added to wiki: https://github.com/PiBa-NL/pfsense-haproxy-package-doc/wiki/haproxy_pass_clientip_to_webserver
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.