Server Load Balancing : Configuring content rewriting
 
Configuring content rewriting
You can create rules to rewrite the following HTTP header fields:
HTTP Host
HTTP Referer
HTTP Location
The Host, Referer, and Location header fields include domain names. For example, the Host field in an HTTP header has the following form:
Host: www.example.com
You might rewrite the HTTP headers for various reasons, including the following:
Content routing—If you configure content-based routing, you might also need to configure content rewriting to ensure the hostnames and URIs in the HTTP header files are consistent.
Aesthetic reasons—To make the URL more easily memorized by customers.
Security reasons—For example, to hide the URL structure of an application that would otherwise help attackers to fingerprint a vulnerable application.
Before you begin:
You must have a good understanding of HTTP header fields.
You must have Read-Write permission for Load Balance settings.
After you have configured a content rewriting rule, you can select it in the virtual server configuration.
To configure a content rewriting rule:
1. Go to Server Load Balance > Virtual Server.
2. Click the Content Rewriting tab.
3. Click Add to display the configuration editor.
4. Complete the configuration as described in Table 10.
5. Save the configuration.
Table 10: Content rewriting rule guidelines
Settings
Guidelines
Name
Unique name. No spaces or special characters.
After you initially save the configuration, you cannot edit the name.
Action Type
Select whether to rewrite the HTTP request or HTTP response.
HTTP Request Rewrite Actions
Redirect
Rewrites the Location header field with the URL you specify.
Rewrite HTTP Header
Host—Rewrites the Host header by replacing the hostname with the string you specify.
URL—Rewrites the Host header by replacing the whole URL with the string you specify.
Referer—Rewrites the Referer header with the URL you specify.
Send 403 forbidden
Send a 403 Forbidden response instead of forwarding the request.
HTTP Response Rewrite Actions
Rewrite HTTP Location
Rewrites the Location header field with the URL you specify.
Condition Table
Object
Select content matching conditions based on the following parameters:
HTTP Host Header
HTTP Location Header
HTTP Referer Header
HTTP Request URL
Source IP Address
Type
String
Regular Expression
Content
Specify the string or regular expression syntax.
Reverse
Rule matches if traffic does not match the expression.
Reordering
After you have saved a rule, reorder rules as necessary. The match condition table is consulted from top to bottom. The first rule that matches is applied and subsequent rules are not evaluated.