Forum Discussion
hooleylist
Feb 03, 2009Cirrostratus
If the maintenance page contains references to other objects (like images or css, etc) you could rewrite the URI only if the request is to a page that hasn't been rewritten already. You would want to use a path and page that does not exist in the application already:
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 splash_pool
} else {
Use the default pool
pool $default_pool
}
}
Aaron