Forum Discussion
JRahm
Dec 16, 2008Admin
I had a situation where I addressed this a few years back. Here's a cleaned up version of that effort:
when HTTP_REQUEST {
if { [HTTP::cookie exists "ssl_persist"] } {
if { [catch { pool [lindex [HTTP::cookie ssl_persist] 1] member [lindex [HTTP::cookie ssl_persist] 2] [lindex [HTTP::cookie ssl_persist] 3] }] } {
HTTP::redirect "https://[lindex [HTTP::cookie ssl_persist] 0]/[HTTP::uri]/"
} else {
pool [lindex [HTTP::cookie ssl_persist] 1] member [lindex [HTTP::cookie ssl_persist] 2] [lindex [HTTP::cookie ssl_persist] 3]
}
}
}
when HTTP_RESPONSE {
HTTP::cookie insert name ssl_persist value [concat [virtual name] [LB::server]]
}
Note that in the redirect line, the first element in the list is the virtual name, not the address, so if it is not the FQDN of your local virtual (not the GTM wideIP), then you'll need to provide some means to extract that. This can be handled in a data class like this and then extracted with findclass:
class mySiteVips {
mySiteAVipName my.siteA.VipFQDN
mySiteBVipName my.siteB.VipFQDN
}
HTTP::redirect "https://[findclass [lindex [HTTP::cookie ssl_persist] 0] $::mySiteVips " "]/[HTTP::uri]/"
HTH... 🙂