Forum Discussion
danjerman_19651
Nimbostratus
Sep 28, 2009Pool level header insert or cookie persistence via iRule?
Hi,
I have a v4 config that is rule based..
i.e. if condition a then use pool pool_a elseif condition b use pool pool_b
pool pool_a {
header insert "ClientIPAddress: ${client_addr}"
member x.x.x.x:1234
member x.x.y.y:1234
}
pool pool_b {
persist_mode cookie
cookie_mode insert
cookie_name Mycookie
cookie_expiration 0d 00:30:00
member x.x.x.x:5678
member x.x.y.y:5678
}
...I now need to migrate this to v9 but am having issues with how to select the cookie persistence or header insert within the rule. The bit for selecting the pool based on HTTP::uri is straightforward but as there doesn't seem to be a way to attach header insert or cookie persistence at the pool level (only at the VIP level) in v9, I'm not sure what to do.
I'm think the rule is the solution but am not sure. Can anyone point me in the right direction please?
Many Thanks
DM
- The_Bhattman
Nimbostratus
Hi DM,when HTTP_REQUEST { if {[HTTP::uri] eq "/blah" } { HTTP::header insert "ClientIPAddress" [IP::client_addr] pool poolA } elseif{ [HTTP::uri] eq "/blahblah" } { persist cookie insert "Blah_poolb_Cookie" "0d 00:30:00" pool poolB } }
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/blah" { HTTP::header insert "ClientIPAddress" [IP::client_addr] pool poolA } "/blahBlah" { persist cookie insert "Blah_poolb_Cookie" "0d 00:30:00" pool poolB } } }
- danjerman_19651
Nimbostratus
Thanks CB. Thats exactly what I was after.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects