How to Insert backend service IP in an HTTP response sent to client from NetScaler

How to Insert backend service IP in an HTTP response sent to client from NetScaler

book

Article ID: CTX225152

calendar_today

Updated On:

Description

The customer had a requirement wherein he wanted to insert the IP address of the backend service (in an HTTP response) to which the NetScaler forwarded the HTTP request after load-balancing.
Although inserting this information can be considered a security risk, it can be useful during diagnosis and testing.


Instructions

Configuration
 
To achieve the above requirement we need to configure the below rewrite policy.
 
How to configure policy from GUI


1. Create a Rewrite action as shown below

User-added image

2. Create a Rewrite policy as shown below

User-added image

3. Bind the Rewrite policy to the necessary Load balancing Virtual Server as a “Response Rewrite”

User-added image

User-added image

How to configure the policy from CLI
 
add rewrite action INSERT_BACKEND_IP_ACTION insert_http_header BACKEND-IP SERVER.IP.SRC
add rewrite policy INSERT_BACKEND_IP_POLICY HTTP.RES.IS_VALID INSERT_BACKEND_IP_ACTION
bind lb vserver IIS-LB -policyName INSERT_BACKEND_IP_POLICY -priority 100 -gotoPriorityExpression END -type RESPONSE

How to Verify
 
Access the VIP from client browser, use any tool that can capture HTTP requests (WireShark / Fiddler / Developer Tools on a browser). In the response from NetScaler you can find the HTTP header inserted as BACKEND IP as shown below

User-added image