Forum Discussion
nik_65678
Nimbostratus
Oct 30, 2009irule-based redirection & maintenance page
i'm trying to figure out a good irule-based solution for an irule-based downtime/maintence page. i already have the code for my downtime page done, however i'm wondering how to implement it on many p...
spark_86682
Oct 30, 2009Historic F5 Account
If your iRule really is that simple, then I have two suggestions. First, you could use variables:
switch [string tolower [HTTP::host]] {
"www.host.com" {
set uppool www.host.com_80
set dnpool downtime_pool_80
}
"www.host2.com" {
set uppool www.host2.com_80
set dnpool downtime_pool_80
}
"www.host2.com" {
set uppool www.host3.com_80
set dnpool downtime2_pool_80
}
}
if { [active_members $uppool] > 0 } {
use pool $uppool
} else if { [active_members $dnpool] > 0 } {
use pool $dnpool
} else {
Server up LB-hosted maintenance page
}
The second suggestion would be to replace the switch statement with datagroups. This would help if you start getting large numbers of sites and want to keep your logic separate from your configuration.
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
