Cookie persistence 4.x to 10.x config conversion
I have a 4.x config with the following:
- pool A with cookie persistence
- pool A inserts cookie XPTO_A
pool poolA {
lb_method observed_member
persist cookie
cookie_mode insert
cookie_name XPTO_A
cookie_expiration 0d 00:04:00
member 1.1.1.10:80
}
- pool B with no persistence configured
pool poolB {
member 1.1.1.20:80
}
- rule calling pool A or poolB, depending on some "ifs":
if (http_host == "xptoA.com") {
use pool poolA
}
else if (http_host == "xptoB.com") {
use pool poolB
}
So, we have here a rule that depending on the "ifs", it does or does not do persistence via cookies.
Can you please help me and check to see if my below procedure is correct, in order to convert that config from 4.x to 10.x?
What I think it is the best conversion from 4.x config to 10.x:
1. configure the default persistence profile for the virtual server in question as cookie
2. configure the iRule to perform the persistence or not, based on the "ifs":
when HTTP_REQUEST {
set http_host_value [string tolower [HTTP::host]]
if {$http_host_value eq "xptoA.com"}
{
persist cookie insert "XPTO_A" "0d 00:04:00"
pool poolA
}
else if {$http_host_value eq "xptoB.com"}
{
persist none
pool poolB
}
}
Is it enough? Do you think it will work? It is the best way to do the conversion?
Thanks in advance.
JPL