Forum Discussion
Fotios_30046
Nimbostratus
Feb 26, 2010Combine Two Rules Into One
I have two rules that perform the same function but on different domains. If a subfolder of /products is found use a different pool, otherwise use the default. My question is, can these be combined ...
hoolio
Cirrostratus
Feb 26, 2010I like the last option, but just be sure to use a OneConnect profile if you're not specifying a pool for all cases. Else, you could save the name of the VIP's default pool and specify it as a default:
when CLIENT_ACCEPTED {
Save the name of the VIP's default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST [
if { [HTTP::uri] starts_with "/products" } {
switch [string tolower [HTTP::host]] {
"www.domain1.com" { pool Altruik-Furniture; return }
"www.domain2.com" { pool Altruik-CarpetOne; return }
}
}
If we're still in the rule, there wasn't a match
so explicitly use the default pool
pool $default_pool
}
If you don't specify the pool in all cases and don't use a OneConnect profile, multiple requests on the same TCP connection can go to the wrong pool. See this post for details:
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=1167449&ptarget=1167577
Aaron
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