beautypg.com

Brocade Virtual ADX Server Load Balancing Guide (Supporting ADX v03.1.00) User Manual

Page 277

background image

Brocade Virtual ADX Server Load Balancing Guide

261

53-1003247-01

Layer 7 content switching

5

The highlighted URLs in the following two HTTP request messages show the difference between the
original request and the one after being rewritten.

Example Original HTTP request:

GET /abc/xyz/index.html HTTP/1.1\r\n

Host: www.example5.com\r\n

User-Agent: Mozilla/5.0 Netscape/7.02\r\n

Accept-Charset: ISO-8859-1\r\n

Cookie: name=brocadenet; userid=12345\r\n

\r\n

Example Rewritten HTTP request:

GET /abc/hello-world/xyz/index.html HTTP/1.1\r\n

Host: www.example5.com\r\n

User-Agent: Mozilla/5.0 Netscape/7.02\r\n

Accept-Charset: ISO-8859-1\r\n

Cookie: name=brocadenet; userid=12345\r\n

\r\n

Inserting a string at negative offset
To configure a request to insert a string after a CSW rule match, follow these steps.

1. Define a CSW rule for HTTP URL content.

Virtual ADX(config)#csw-rule r22 url prefix /abc/

Syntax: csw-rule rule-name url prefix prefix-content

2. Define a CSW policy.

Virtual ADX(config)#csw-policy mypolicy

Syntax: csw-policy policy-name

3. Specify a primary action.

Virtual ADX(config-csw-mypolicy)#match r22 forward 1025

Syntax: match rule-name forward server-id

4. Specify a dependent rewrite action.

Virtual ADX(config-csw-mypolicy)#match r22 rewrite request-insert /hello-world

neg-offset 5

Syntax: match rule-name rewrite request-insert content neg-offset offset

NOTE

The following information assumes you have already completed the previous configuration.

NOTE

If you want to insert a string at the beginning of a URL, make sure that the string always starts with
a "/", or the server that receives the request returns a response of "bad request." This response
indicates the format is invalid. The assumption is that the URL always starts with a "/".