beautypg.com

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

Page 279

background image

Brocade Virtual ADX Server Load Balancing Guide

263

53-1003247-01

Layer 7 content switching

5

Syntax: match rule-name rewrite request-replace matched-string new-string

The rule-name variable defines the name of CSW rule.

The matched-string keyword defines the matched string (defined by CSW rule), which is to be
replaced.

The new-string variable defines the new string that replaces the previous string.

NOTE

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

The url-exist matches the entire URL, so the matched string is the whole URL
"/abc/xyz/index.html." It is replaced by the new string "/newabc/newxyz/newindex.html."

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 /newabc/newxyz/newindex.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

Replace a defined string
To configure a request to replace a specific string in a CSW rule match, follow these steps.

1. Define a CSW rule for HTTP URL content.

Virtual ADX(config)#csw-rule r32 url pattern "abc"

Syntax: csw-rule rule-name url pattern pattern-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 r32 forward 1025

Syntax: match rule-name forward server-id

4. Specify a dependent rewrite action

Virtual ADX(config-csw-mypolicy)#match r32 rewrite request-replace string

"xyz" "1234"

Syntax: match rule-name rewrite request-replace string old-string new-string

The rule-name variable defines the name of the CSW rule.