How to Change Redirect Destinations using Response Rewrite Rules in NSX LB
search cancel

How to Change Redirect Destinations using Response Rewrite Rules in NSX LB

book

Article ID: 433359

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Web servers may use the Location field in HTTP responses to redirect clients to a specific destination.
  • This article describes how to rewrite the redirect URL using Response Rewrite Load Balancer Rules in NSX LB.

Environment

VMware NSX

Resolution

  • To create a Response Rewrite Load Balancer Rule in the NSX native load balancer, navigate to Networking > Load Balancing > Virtual Servers in the NSX Manager.

  • Add a rule under the Response Rewrite Phase of the target Virtual Server as follows:
    •   Match Condition
      Condition: HTTP Response Header
      Header Name: Location
      Match Type: any value
      Header Value: any value

    •  Action
      Action: HTTP Response Header Rewrite
      Header Name: Location
      Header Value: any value

In this configuration example, the NSX LB overwrites the Location header to https://example.org/example.html only when the web server responds with https://example.com/example.html.

 

Additional Information

Redirect destinations can also be configured within the Application Profile.
For more additional information refer NSX-T LB Encyclopedia.