Explanation of offsets – Brocade Virtual ADX Server Load Balancing Guide (Supporting ADX v03.1.00) User Manual
Page 281
![background image](/manuals/361724/281/background.png)
Brocade Virtual ADX Server Load Balancing Guide
265
53-1003247-01
Layer 7 content switching
5
HTTP redirect status code
The Brocade Virtual ADX can be configured to use a temporary or permanent move to suit different
application requirements:
•
301 - To redirect the HTTP request to a new, assigned permanent URI.
•
302 (the default) -To redirect HTTP requests to a temporary URI.
To redirect an HTTP request with redirect code 301, enter the following command.
Virtual ADX(config)#csw-policy p1
Virtual ADX(config-csw-p1)#match r1 redirect "brocade.com" HTTP 301
Explanation of offsets
NOTE
The offset or neg-offset keyword indicates that insertion or deletion starts after or before the offset
of the interested content defined in the matched CSW rule.
In this example, the Brocade Virtual ADX receives the following message.
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
The following examples show how the offsets work for various rules.
Prefix matching
csw-rule ruleA url prefix /abc/x
Offset 0 points to "y", which is the next byte after "/abc/x" in the URL.
Suffix matching
csw-rule ruleB header Host suffix com
Offset 0 points to "\r", which is the next byte after "com" in the value of "Host" header
"www.example5.com".
Pattern matching
csw-rule ruleC header Host pattern foo.
Offset 0 points to "c", which is the next byte after "foo." in the value of "Host" header
“www.example5.com”.
Exist matching
csw-rule ruleD1 url exist
Offset 0 points to white space after the letter "l", which is right after the last byte of URL
"/abc/xyz/index.html".
Equal matching
csw-rule rule header "Host" equal "www.example5.com"