Forum Discussion
Rob_Wotton_8024
Nimbostratus
Oct 20, 2009Pool redirection and healthcheck
Hi,
I have been banging my head against the wall for the past couple of days with this one, so any help would be greatly appreciated.
We need to redirect certain URL's to a specific pool, however, we would also like to include a health check against that pool and the pool is down use a different pool.
Below is my attempt at the rule, but as you can probably tell it doesn’t work. Can anyone offer some help?
Many thanks
Rob
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if {{ $uri starts_with "/sitea " } and {[active_members webpool-1]}}
{
pool webpool-1
}
elseif { $uri starts_with "/site1" }
{
pool webpool-2
}
elseif {{ $uri starts_with "/siteb" } and {[active_members webpool-1]}}
{
pool webpool-1
}
elseif { $uri starts_with "/siteb" }
{
pool webpool-2
}
else {
if {[active_members defaultpool-1]} {
pool defaultpool-1
}
else {
pool defaultpool-2
}
}
}
- hoolio
Cirrostratus
If you use a two pool approach, you would probably want to also check if the second pool has active members before using it. And then you'd want to handle the case where both pools are down.when HTTP_REQUEST { Check requested URI switch [string tolower [HTTP::uri]] { "/sitea" { pool webpool-1 } "/siteb" { pool webpool-2 } default { pool webpool-2 } } }
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