X-FORWARDED-FOR for Exchange

Андрей Михалевский 3,451 Reputation points
2024-02-15T13:39:03.5333333+00:00

Hello. Haproxy + Exchange 2019 on-premise. I am using Haproxy for client balancing.

Haproxy does not pass the address of the client, but of the server itself. I can see it in IIS logs.

After researching Haproxy, I found parameters to enable real IP address transmission.

I followed the recommendations in this article: https://techcommunity.microsoft.com/t5/iis-support-blog/how-to-use-x-forwarded-for-header-to-log-actual-client-ip/ba-p/873115.

But this did not result in success.

How can I get the real address of the client ?

haproxy

Exchange | Exchange Server | Other
Windows development | Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. Yuki Sun-MSFT 41,376 Reputation points Moderator
    2024-02-16T03:25:54.64+00:00

    Hi @Андрей Михалевский

    After researching Haproxy, I found parameters to enable real IP address transmission.

    According to this blog, X-Forwarded-For Header (XFF) requires to be enabled on your Proxy or Load balancer prior to adding this field in IIS:
    User's image

    So, I'd like to confirm, by "found parameters to enable real IP address transmission", do you mean you've already followed the guidance from Haproxy to enable it?

    Besides, I found a thread below which includes a working haproxy.cfg file shared by the poster, you can have a look at it to see if it can be of some help:

    haproxy and forwarding client IP address to servers (Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.)

    In addition, considering that the issue involves IIS, I'll add the IIS tag so that their community can look into this issue as well.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.