IIS Reverse Proxy - forward user IP instead of server IPRSS

2 replies

Last post Feb 07, 2021 06:36 AM by Brucz

‹ Previous Thread|Next Thread ›
  • IIS Reverse Proxy - forward user IP instead of server IP

    Feb 05, 2021 10:01 AM|LuckVintage|LINK

    Hello there,

    I have an apache webserver running on my Linux server that hosts my online Forum Community. I use IIS for the rest of my websites, therefore I have set-up a reverse proxy on IIS for the apache webserver. However, the IP address of every member on the forum is the local IP address of my IIS server.

    I have looked at many different guides online about how to forward the correct IP address from IIS to the apache website, hwever I have been unsuccessful at this and find some of the guides online outdated / hard to understand.

    Please could someone help me achieve this?

    Many Thanks!

  • Re: IIS Reverse Proxy - forward user IP instead of server IP

    Feb 06, 2021 07:14 PM|lextm|LINK

    A reverse proxy can only forward the original client IP (from the browser side) via certain HTTP headers like https://en.wikipedia.org/wiki/X-Forwarded-Forhttps://en.wikipedia.org/wiki/X-Forwarded-Forhttps://en.wikipedia.org/wiki/X-Forwarded-For So if your web app on Apache side does not pick up the right IP address from such headers, it will show the IP address of the reverse proxy instead.

    What you might do right now is,

    • Confirm that IIS reverse proxy sends the correct IP via HTTP headers.
    • Check the forum web app documentation to see how to configure it to use the IP address from HTTP headers.
    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: IIS Reverse Proxy - forward user IP instead of server IP

    Feb 07, 2021 06:36 AM|Brucz|LINK

    Hi LuckVintage,

    In the reverse proxy of IIS, the client IP is stored in the X-Forwarded-For header by default. If your apache server does not read this header or the application does not record this header, the apache log always contains IIS server IP address.

    You can change X-Forwarded-For to other headers in ARR. Open Server Proxy Setting in ARR.

    Best regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
‹ Previous Thread|Next Thread ›