LTM Maintenance Page Lite
Published Mar 18, 2015
Version 1.0Was this article helpful?
Hi,
I understand why there are some issues with this code... the code is not generic, it use some useless static configuration : pool name, http protocol...
Redirect must never include host and protocol if the target service is the same as current.
I changed the redirect and refresh URL to relative URL. the pool name is the one assigned to the tcp connection. I also change the refresh URL to previous URI and not /. this allow user to follow browsing and not go back to home page.
when RULE_INIT {
sets the timer to return client to host URL
set static::stime 10
}
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check if the URI is /maintenance
switch [HTTP::uri] {
"/maintenance" {
Send an HTTP 200 response with a Javascript meta-refresh pointing to the host using a refresh time
HTTP::respond 200 content \
"Maintenance page\
Sorry! This site is down for maintenance." "Content-Type" "text/html"
return
}
}
If the default pool is down, redirect to the maintenance page
if { [active_members $default_pool] < 1 } {
HTTP::redirect "/maintenance"
return
}
}