beautypg.com

Configuring rewrite request-insert – Brocade Virtual ADX Server Load Balancing Guide (Supporting ADX v03.1.00) User Manual

Page 276

background image

260

Brocade Virtual ADX Server Load Balancing Guide

53-1003247-01

Layer 7 content switching

5

\r\n

Example Rewritten HTTP request:

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

Host: www.example5.com\r\n

User-Agent: Netscape/7.02\r\n

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

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

\r\n

Configuring Rewrite request-insert

Content insertion allows the Brocade Virtual ADX to insert any string either right after the matched
string found by the CSW rule, or at any specified offset in the content located by the matched CSW
rule. Use the following procedures to configure a string insert at a positive offset or a negative
offset.

NOTE

For more information about offsets, refer to

“Explanation of offsets”

on page 265.

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

1. Define a CSW rule for the HTTP prefix of the URL.

Virtual ADX(config)#csw-rule r21 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 r21 forward 1025

Syntax: match rule-name forward server-id

4. Specify a dependent rewrite string.

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

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

NOTE

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

NOTE

If no offset is defined, the Brocade Virtual ADX will always insert at offset 0.

Offset 0 is at the second "/", which is right after matched prefix "/abc", as defined in CSW "r21".
The result is that the string "/hello-world" is inserted at the default offset 0, which is after letter "c".
The original URL becomes "/abc/hello-world/xyz/index.html".