Forum Discussion
Matt_Breedlove_
Nimbostratus
Hi Rajendra,
You can do both types of persistence on the same VS, but you will probably want to remove the persistence from the VS itself and rely on the IRULE to do all the persistence.
In the irule this is easy to do. You can isolate the persistence in the logic of the irule and tell the current connection to persist on JSESSIONID or on cookie persistence depending on the condition. Let me know if you need more help with getting this implemented. If you can paste the current irule/VS config you are working with, that could be helpful
Thanks Matt
Rajendra_129865
Jun 21, 2014Nimbostratus
Thanks Matt for your suggestion. Below I have listed the entire VIP configuration example. I also tried to use the below statements in rule1 for specific URI persistence. This worked for only login and application login and logout session. But traffic related to any process done after logging to the application, used to load balance among the pool members and application breaks.
"/abc*" {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"] 300
}
pool pool_abcservers
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist add uie [HTTP::cookie "JSESSIONID"]
}
}
*********************************
virtual vs_X.X.X.X_https {
snatpool Automap
pool defaultapp_pool
destination X.X.X.X:https
ip protocol tcp
rules {
rule1
rule2
rule3
}
persist cookie_encrypt
profiles {
http_xforward {}
oneconnect {}
tcp {}
Client_SSL {
clientside
}
}
}
rule rule1 {
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/abc*" {
pool pool_abcservers
persist uie JSESSIONID_Persistence
}
"/xyz*" {
pool pool_xyzservers
}
"/bcd*" {
pool pool_bcdservers
}
}
}
}
rule rule2 {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {($host contains "abc.example.com") } {
node 1.2.3.4 8001
}
}
}
rule rule3 {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { ($host contains "qa-fs") or ($host contains "qa-sg") } then {
node 10.10.10.25 80
} elseif { $host contains "qa-fs.examblog" } then {
node 10.10.10.25 90
} elseif { ($host contains "dev") or ($host contains "dev-exam") } then {
node 10.10.10.35 80
} elseif { $host contains "dev.examblog" } then {
node 10.10.10.35 90
}
}
}
*********************************