Forum Discussion
Jace_45978
Mar 19, 2012Nimbostratus
persistence based on uri call
would like to add persistence profile if client makes call with /admin in the uri to the VS otherwise there is no persistence on the VIP.
I plan on adding a universal persistence to the VS with this following iRule can someone let me know if i am on track?
client makes call to https:///dispatch/admin/StartAdmin.html
virtual fp230 {
snat automap
pool ds-8080
destination 10.10.10.10:https
ip protocol tcp
profiles {
fp230-stg_sslprofile {
clientside
}
http {}
tcp {}
}
}
profile persist f3p_35min_persist {
defaults from source_addr
mode source addr
timeout 2100
}
thinking the irule would look like this??
when HTTP_REQUEST {
if { [URI::path] contains "/admin" } {
persist f3p_35min_persist }
}
- koenning_107182NimbostratusHi Jace,
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/admin" } { persist source_addr 255.255.255.255 2100 } }
- Jace_45978Nimbostratuswe are unable to persist based off cookie. This is one of those VS that the only persistence they want is when they go to the admin console.
- koenning_107182NimbostratusHi Jace,
when HTTP_REQUEST { if { [HTTP::uri] equals "/dispatch/admin/StartAdmin.html" } { persist source_addr 255.255.255.255 2100 } }
- Jace_45978NimbostratusGreat thanks Christian. I we will be implementing this rule tomorrow I will let you know if there are any issues. I appreciate your input!
- hooleylistCirrostratusI think the persist command might stay in effect for the rest of the connection. So you might want to disable persistence for non-matching URIs:
when HTTP_REQUEST { if { [HTTP::uri] equals "/dispatch/admin/StartAdmin.html" } { persist source_addr 255.255.255.255 2100 } else { persist none } }
I actually have a follow-up
I have following irule:
when HTTP_REQUEST {
if { ([HTTP::uri] contains "Communication") or ([HTTP::uri] contains "Builder") }{ persist cookie pool XYZ } elseif { ([HTTP::uri] contains "PDFTemp") or ([HTTP::uri] contains "DOCTemp") or ([HTTP::uri] contains "Servicenew") or ([HTTP::uri] contains "ServiceCorrespondence")}{ log local0. "Client IP = [IP::client_addr]" persist none pool ABC }
}
But I am not still seeing Persistence on second pool ABC and I had to put the Persistence method cookie on Virtual servers Resources, Default Persistence Profile Section.
If I don't put that on the Virtual server, it gives an error that irule is using Persistence method so VS needs to have "cookie" in VS > Resources > Default Persistence Profile Section : "Cookie"
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