How to configure the "X-Forwarded-For" header in the NSX native Load balancer
search cancel

How to configure the "X-Forwarded-For" header in the NSX native Load balancer

book

Article ID: 421678

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Web servers may need information, such as client IP, for logging or other purposes.
  • In case of LB-NAT configuration on the Pool, Web servers will see the LB-NAT IP address in the source IP.
  • However configuring the web servers to look at those HTTP headers, they can still retrieve the real Client IP information by inserting the Client IP in the X-Forwarded-For field in the header.

Environment

VMware NSX

Resolution

To configure the X-Forwarded-For in the NSX native Load balancer, In the NSX Manager, navigate to Networking > Load Balancing > Profiles.

Either edit the existing application profile assigned to the virtual server or add a new Application Profile with HTTP, ensuring you select X-Forwarded-For: Insert and assign the profile to required virtual server.

Note:

Insert: If the XFF HTTP header is not present in the incoming request, then the LB inserts a new XFF header with the client IP@. If XFF HTTP header is present in the incoming request, then the LB appends the XFF header with the client IP@.

Replace: If the XFF HTTP header is already present in the incoming request then the LB replaces the header.

Additional Information

For more additional information refer NSX-T LB Encyclopedia: https://community.broadcom.com/viewdocument/nsx-t-lb-encyclopedia?CommunityKey=b76535ef-c5a2-474d-8270-3e83685f020e&tab=librarydocuments