Forum Discussion
JeffM
Nimbostratus
Oct 24, 2014Having issue with multiple if statements for irule
What I am trying to do is have / and specific data group list URIs going to pool B and the rest of the traffic going to pool A. Issue is that when a URI contains part of an entry in the data group l...
kunjan_118660
Cumulonimbus
Oct 24, 2014I need if the top IF statements match to exit the irule and use the defined pool.
Are your referring to this:
if { ( [HTTP::uri] equals "/" ) or ( [class match [string tolower [HTTP::uri]] starts_with dgl_aem.domain.com] ) } {
What is the string list in dgl_aem.domain.com expected to match here?
JeffM
Nimbostratus
Oct 24, 2014Originally I had the following irule:
when HTTP_REQUEST {
if { ( [HTTP::uri] equals "/" ) or ( [class match [string tolower [HTTP::uri]] starts_with dgl_aem.domain.com] ) } {
pool pool_alternate.com
} else {
pool pool_default.domain.com
}
The data group list (dgl_aem.domain.com) had all the URIs for the alternate pool. The problem that has come up is that for example /legal-documents/ is defined in the data group list to (as it should) to point to the alternate pool but the URI /legal-documents/insurance needs to point to the default pool.
So to allow these few exception URIs to hit the default pool before the data group was read I thought I could do this iRule:
when HTTP_REQUEST {
if { ( [HTTP::uri] equals "/A/documents" )
or ( [HTTP::uri] equals "/B/documents" )
or ( [HTTP::uri] equals "/C/documents" )
or ( [HTTP::uri] equals "/D/documents" )
or ( [HTTP::uri] equals "/E/documents" )} {
pool pool_default_domain.com
}
if { ( [HTTP::uri] equals "/" ) or ( [class match [string tolower [HTTP::uri]] starts_with dgl_aem.domain.com] ) } {
pool pool_alternate.com
} else {
pool pool_default.domain.com
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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