Michael_Yates
Jan 22, 2008Nimbostratus
HTTP Request rewrite before sending to specified node
I'm trying to make an iRule that will enable website testing on different specified nodes. Because most of the website that need to be testing in this way are URL dependent I wanted to do the testing by adding to the URL, and having the F5 remove the URL additions before sending the traffic to the specific node.
Something like this, but this doesn't rewrite the URL properly before sending the traffic to the node and fails with "node1" not found.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/node1" } {
set newpath [findstr [HTTP::uri] "node1" 5]
node 192.168.1.1 8080
}
if { [HTTP::uri] starts_with "/node2" } {
set newpath [findstr [HTTP::uri] "node2" 5]
node 192.168.1.2 8080
} else {
pool $myPool
}
}
What I need is the following:
http://foo.website.com/node1
Then have the F5 strip out the "/node1" and send http://foo.website.com to the specified node.
Any help or is greatly appreciated.