Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    HAProxy How to get the user real IP address

    Scheduled Pinned Locked Moved Cache/Proxy
    2 Posts 2 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cjbujold
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • P Offline
        PiBa
        last edited by

        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-NL

        Edit:
        Added to wiki: https://github.com/PiBa-NL/pfsense-haproxy-package-doc/wiki/haproxy_pass_clientip_to_webserver

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.