David_X_20743
May 09, 2008Nimbostratus
LB method setup and post redirect
Hi
I am new to the F5 iRules. I am currently setting up a set of of iRules for a customer and get really lost. So any suggestion will be really appreciated.
The customer wish to setup the F5 to look at the Host HTTP header and if it is
test.test4u.com to balance it round robin style between the two web servers 192.168.1.168 and 192.168.1.132
They also wish the F5 to look at the sysid HTTP Post variable and if this is set to 1, send the traffic to 192.168.1.168, if set to 2 send the traffic to .132 if it is not set then balance in the normal way. This is set when a user pages inside the results, and it uses the web server memory cache so it needs to go the same server that produced the result set.
I wrote the following iRules, but it does not seem to be working
when HTTP_REQUEST {
if { [HTTP::header "HOST"] contains "test.test4u.com" } {
LB::mode roundrobin
}
if { [HTTP::method] eq "POST" } {
if {[HTTP::header names] contains "sysid=1" } {
node 192.168.1.168 80
}
if {[HTTP::header names] contains "sysid=2" } {
node 192.168.1.132 80
}
}
}
Thank you