beautypg.com

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

Page 280

background image

264

Brocade Virtual ADX Server Load Balancing Guide

53-1003247-01

Layer 7 content switching

5

The old-string variable defines the string to be replaced, if it can be found in the URL defined by
the CSW rule. If the old-string variable is not found, the replacement will not happen.

The new-string variable defines the string with which the old string is to be replaced.

NOTE

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

Because the URL contains the pattern "abc," rule r32 will be hit. Then a search for string "xyz" also
is positive, so "xyz" will be replaced with string "1234". The following two HTTP request messages
show the difference between the original request and the rewritten request.

Example Original 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

Example Rewritten HTTP request:

GET /abc/1234/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 redirect

The redirect action causes the Brocade Virtual ADX to redirect a request to an alternate domain,
URL, port, or Uniform Resource Identifier (URI) when the specified rule is matched.

For example, the following command causes the Brocade Virtual ADX to redirect a request to the
domain brocade.com, URL
/home/index.html, and port 8080 when rule r1 is matched.

Virtual ADX(config-csw-policy1)#match r1 redirect "brocade.com"

"/home/index.html" 8080

Syntax: [no] match rule-name redirect domain [url | [port status-code] | [url new-port]]

The rule-name variable can be up to 80 characters in length.

The domain variable can be up to 255 characters.

The url variable can be up to 255 characters.

You can optionally specify * (asterisk) for either the domain or url variables. When you do this, the
redirected request uses the same domain or URL as in the original request.

For the port variable, you can enter any well-known port name or port number. For the status-code
variable, enter any three-digit status code.

For the url new-port variables, enter the new URL and port number to which the request will be
redirected.