248 Citrix NetScaler Policy Configuration and Reference Guide

To redirect HTTP URLs to HTTPS by using the command line

1.To create a Rewrite action named act_replace_http_with_https that replaces all instances of the string “http” with the string “https”, at the NetScaler command prompt, type:

add rewrite action act_replace_http_with_https replace_all 'http.res.body(100)' '"https"' -pattern http

2.To create a Rewrite policy named pol_replace_http_with_https that detects connections to the Web server, at the NetScaler command prompt, type:

add rewrite policy pol_replace_http_with_https TRUE replace_https NOREWRITE

3.Bind your new policy globally.

Removing Unwanted Headers

This example explains how to use a Rewrite policy to remove unwanted headers. Specifically, the example shows how to remove the following headers:

Accept Encoding header. Removing the Accept Encoding header from HTTP responses prevents compression of the response.

Content Location header. Removing the Content Location header from HTTP responses prevents your server from providing a hacker with information that might allow a security breach.

To delete headers from HTTP responses, you create a rewrite action and a rewrite policy, and you bind the policy globally.

To create the appropriate Rewrite action by using the NetScaler command line

At the NetScaler command prompt, type one of the following commands to either remove the Accept Encoding header and prevent response compression or remove the Content Location header:

add rewrite action "act_remove-ae" delete_http_header "Accept-Encoding"

add rewrite action "act_remove-cl" delete_http_header "Content-Location"

To create the appropriate Rewrite policy by using the NetScaler command line

At the NetScaler command prompt, type one of the following commands to remove either the Accept Encoding header or the Content Location header:

Page 262
Image 262
Citrix Systems 9.2 manual Removing Unwanted Headers