Forum Discussion
rwagner1
Nimbostratus
Aug 16, 2017iRule for App Offline
We currently use an iRule to display an app offline page when the connection to the server is down.
I would like to some how to make this as generic as possible due to wanting to use host headers.
He...
Stanislas_Piro2
Cumulonimbus
Aug 22, 2017Hi,
I use following irule to manage maintenance page per pool.
with this rule, pool can be assigned by a irule executed before or by an LTM Policy.
when HTTP_REQUEST {
switch [HTTP::path] {
"/maintenance/logo.png" {
HTTP::respond 200 content [ifile get "logo.png"] "Content-Type" "image/png"
return
}
"/maintenance/maintenance.html" {
HTTP::respond 200 content [ifile get "maintenance.html"] "Content-Type" "text/html"
return
}
"/maintenance/error.html" {
HTTP::respond 200 content [ifile get "error.html"] "Content-Type" "text/html"
return
}
default {
set dpool [LB::server pool]
if { $dpool equals "" } { HTTP::redirect "/maintenance/error.html" ; unset dpool; return}
if { [active_members $dpool] == 0 } { HTTP::redirect "/maintenance/maintenance.html"; unset dpool; return}
unset dpool
}
}
}
when HTTP_RESPONSE {
if { [HTTP::status] eq "404" } { HTTP::redirect "/maintenance/error.html" }
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
