beautypg.com

Deleting content at negative offset – Brocade Virtual ADX Server Load Balancing Guide (Supporting ADX v03.1.00) User Manual

Page 274

background image

258

Brocade Virtual ADX Server Load Balancing Guide

53-1003247-01

Layer 7 content switching

5

The URL prefix "/abc" is matched, offset 0 is at the second "/", which is right after the matched
prefix "/abc" in the URL, which is defined in CSW "r12a"; so offset 4 is number "1" which is 4 bytes
away after the letter "c". The result is that the 2 bytes containing "12" are deleted in the URL.

Example Original HTTP request:

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

Host: www.foo.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/xyz/index.html HTTP/1.1\r\n

Host: www.foo.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

Deleting content at negative offset

NOTE

For more information about offsets, refer to

“Explanation of offsets”

on page 265.

To configure a request to delete content at a negative offset, follow these steps.

1. Define a CSW rule to search for the suffix ".html" at end of URL.

Virtual ADX(config)#csw-rule r12b url suffix ".html"

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

Syntax: match rule-name forward server-id

4. Specify a dependent rewrite action.

Virtual ADX(config-csw-mypolicy)#match r12b rewrite request-delete neg-offset

11 6

Syntax: match rule-name rewrite request-delete neg-offset offset length

NOTE

The following information assumes you have configured the previous scenario.

When ".html" is matched, offset 0 is the white space after letter "l", letter "l" is neg-offset 1, letter
"m" is neg-offset 2, letter "t" is neg-offset 3 and so on. As a result, neg-offset 11 is "_". By counting
6 bytes from left to right starting with "_", you can see that "_index" is to be deleted.