Forum Discussion
mop10011_63574
Nimbostratus
Mar 08, 2009how to rewrite fallback page
Say I have these pools on my F5 ltm:
poolone, pooltwo, poolthree
The dns to get to each of these respectively is:
www.one.com
www.two.com
www.three.com
...
hoolio
Cirrostratus
Mar 10, 2009I think I missed the original point then. If you want to transparently rewrite requests so that the client gets "maintenance page" content when the default pool of the VIP is down, you can use a rule like this (Click here😞
when RULE_INIT {
Use a prefix for the path that does not already exist in the application
set ::maintenance_prefix "/maintenance/"
The default maintenance page
set ::maintenance_page "maintenance.html"
}
when CLIENT_ACCEPTED {
Save the name of the default pool on the VIP
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check if there aren't any active members in the default pool
if { [active_members $default_pool] < 1 } {
Primary members are unavailable. Check if the URI has not already been rewritten.
if {not ([HTTP::path] starts_with $::maintenance_prefix)}{
Rewrite the URI to the maintenance prefix/maintenance page (/maintenance/maintenance.html)
HTTP::uri "$::maintenance_prefix$::maintenance_page"
}
Use the maintenance pool
pool maintenance_pool
} else {
Use the VIP's default pool
pool $default_pool
}
}
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