Forum Discussion
Oct 07, 2013
I´m a bit late with my response, sorry. This approach worked fine for me in v11:
when HTTP_REQUEST {
if {[HTTP::cookie exists BIGipServer[getfield [LB::server pool] "/" 3]]} {
eval [LB::select]
node [LB::server addr] [TCP::local_port]
} else {
pool [LB::server pool]
}
}
If you have i.e. 2 virtual servers (listening on port 80 and port 8080 and map them to a pool with members on port 0) the cookie will always force the incoming requests to the destination port which is encoded into the cookie value. By using the 'eval' command you can figure out the proper poolmember. But you will use the address information only and apply the initial client destination port for selecting the poolmember via node command.
The iRule above will be bound to both / all relevant virtual servers.