beautypg.com

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

Page 273

background image

Brocade Virtual ADX Server Load Balancing Guide

257

53-1003247-01

Layer 7 content switching

5

In this case, "-sample" is the deleted string that CSW rule r11 matches. The request is forwarded to
the server with server ID 1025, which is defined by primary CSW action match r11 forward 1025.
The URLs in the following two HTTP request messages show the difference between the original
request and the rewritten request.

If there is no sub-string "-sample" in the URL of the HTTP request, rule r11 is not hit, the request is
sent to the server with server ID of 1026, which is defined by the default rule default forward 1026.

Example Original HTTP request:

GET /abc/xyz-sample/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/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

Deleting content at positive offset

NOTE

For more information about offsets, refer to

“Explanation of offsets”

on page 265.

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

1. Define a CSW rule to search for a prefix "/abc" in URL.

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

Syntax: match rule-name forward server-id

4. Specify a dependent rewrite action.

Virtual ADX(config-csw-mypolicy)#match r12a rewrite request-delete offset 4 2

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

NOTE

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