Carolyn_Robert_
Dec 12, 2006Nimbostratus
Redirecting to a pool
I'm confused about how to use redirects and pooling.
Here's my situation:
> DNS entry "www.abcd.com" is pointed at my virtual server "gateway"
> VS "gateway" uses pool "PROD", that contains two nodes, "website1" & "website2"
> I need to actually redirect from http to https using the two nodes in the pool while at the same time modifying my URI.
Here's a piece of code:
when HTTP_REQUEST {
if { ([HTTP::host] equals "www.abcd.com") } {
HTTP::uri /xyz.html
pool PROD
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
The [HTTP::host] substitution does not work, because the host needs to be modifed by whichever node the pool picks. So my final URL would be either:
https://website1.abcd.com/xyz.html
OR
https://website2.abcd.com/xyz.html
depending on what the pool determines is the next available candidate for work.
How can I figure out what node is selected by the pooling function so that I can build the full URL for the redirect statement?