Hoolio - Thanks for the post, helpful.. I have not needed to use iRules beyond simple redirects from HTTP to HTTPs and pool selection based on URI.. However, during our migration from v4 to v9 BigIP's we noticed a change in behavior on how the v9 BigIP (v9.1.2) handles cookie insert. In version 4, if the client present a BigIP cookie, the bigip would continue to set the same cookie on subsequent 200 responses. In v9, this is no longer the case. Unfornately, we have some apps that function a middle-man between our BigIP and the client, they work with the BigIP persistence cookie. They require the cookie be set on all 200 responses (or so it appears).. V9 broke the app, but I think an iRule can be used to work-around. Below is a snapshot of the rule that I have working in a lab environment. I would appreciate any comments/suggestions..Or, is there a simpler approach.. Note: logging statements are just for debug, will be removed....
when HTTP_REQUEST {
set poolname [LB::server pool]
set need_bigip_cookie 0
if { [HTTP::cookie exists "BIGipServer$poolname"] } {
set bigip_cookie [HTTP::cookie BIGipServer$poolname]
set need_bigip_cookie 1
log "cookie exists: $bigip_cookie"
}
}
when HTTP_RESPONSE {
Only if HTTP 200 response, re-insert the same cookie
if { [HTTP::status] contains "200" and $need_bigip_cookie == 1 } {
HTTP::cookie insert name BIGipServer$poolname value $bigip_cookie
log "reset cookie, value: $bigip_cookie"
}
}