beautypg.com

Using multiple cookies under virtual server port – Brocade Virtual ADX Server Load Balancing Guide (Supporting ADX v03.1.00) User Manual

Page 289

background image

Brocade Virtual ADX Server Load Balancing Guide

273

53-1003247-01

Using multiple cookies under virtual server port

5

In this configuration, the Brocade Virtual ADX rewrites the HTTP response. Whenever response
code 301 or 302 appears in the header, together with a redirect URL http://www.example6.com
(signified by the Location header), the Brocade Virtual ADX replaces the URL with
https://www.example6.com. In other words, "Location: http://www.example6.com" becomes
"Location: https://www.example6.com."

csw-rule r1 response-status-code 301 302

csw-rule r11 response-header "Location" pattern "http://www.example6.com"

csw-policy "p1" type response-rewrite

match "r1" rewrite response-insert header

match "r11" rewrite request-replace string "https://www.example6.com/" offset 0

length 19

server real rs1 10.1.1.101

port http

port http url "HEAD /"

Using multiple cookies under virtual server port

Configuring multiple unique cookie insertion with
cookie path

This release adds support for multiple cookies. Based on a URL or any content information
contained in a HTTP request, this feature allows Brocade Virtual ADX to introduce to the client user
agent a unique cookie with different attributes, such as domain, path, and expiration time.

In previous releases, cookie insertion was configured under a VIP. With more customers having
multiple sites hosted per VIP, a single cookie to accommodate all the sites is not sufficient. This
feature extends the current implementation of cookie insertion on Brocade Virtual ADX, so that
multiple cookies for different sites and applications can be inserted.

NOTE

The following commands is configured under a CSW policy.

Configuring cookie insertion when a particular CSW rule is hit

To configure cookie insertion when a particular CSW rule is hit, use the following command.

Syntax: match rule-name rewrite insert-cookie [cookie-name [domain [path [age]]]]

If the server l7-dont-use-gateway-mac command is configured along with a CSW rule for cookie
insertion, the embedded link in a web page on the real server (which could be an image) will not
appear.

The reason is because the fetch request for the image is second request and it has a cookie
embedded. This request does not need insert cookie, so it will go through a normal Layer 7
forwarding path. This will need spoofing to be configured in order to forward the packet.

The first request does not have cookie. So it will go through cookie insertion (content rewrite) code
path. This one can take care of server l7-dont-use-gateway-mac command and does not need
spoofing configured. But for server l7-dont-use- gateway-mac command to work, spoofing is
required.