Forwarding Client Real IP ISPConfig Apache

Discussion in 'ISPConfig 3 Priority Support' started by Mo Hammann, Dec 19, 2023.

  1. Mo Hammann

    Mo Hammann New Member

    Hello,
    I have created a domain on ISPConfig and i want to proxy/redirect to another server inside my network. I used apache directives in domain options and everything is working fine except that the target server is getting ispconfig IP only. Apache directives used (the latest now) are below
    on the server 192.168.15.2 i am only getting the IP of ISPConfig which is 192.168.44.16.

    Can anyone help me correct those directives so i can get the Client Real IP ?
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    You need to configure the settings at the server where ISPConfig redirects to not at the ISPConfig server if that is the proxy. As you did not explain what is running on the server behind the proxy we could only assume.

    If it is another apache2 webserver you could use mod_remoteip for example. I guess it's the most up to date solution for such cases.
     
    Mo Hammann likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    As far as I know, it should be enough to just set "ProxyPreserveHost On" so that x-forwarded-for header is set. On the target system, you must then evaluate the x-forwarded-for header to get the IP address, if you want to have the x-forwarded-for address to show up in logs, you must use e.g. mod_remoteip as @pyte suggested. This is the same for any Apache server, so it's not ISPConfig specific.
     
  4. Mo Hammann

    Mo Hammann New Member

    thank you @pyte, it is a Synology Storage (Synology Drive).
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Then you must check the synology docs if their software is able to deal with x-forwarded-for headers.
     
    Mo Hammann likes this.
  6. Mo Hammann

    Mo Hammann New Member

    you really saved me time, I just had to check with Synology settings and I found that it has an option to for Trusted Proxies. I just added the WAN IP of ISPConfig and the Client IPs are showing correctly now.
     
    pyte likes this.

Share This Page