since your maintenance page is simple (no image inside), you may try something like this.
[root@ve10:Active] config b virtual bar80 list
virtual bar80 {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
set static::maint_page "Sorry! This site is down for maintenance."
}
when HTTP_REQUEST {
set maint_prefix "/maintenance.html"
if { [HTTP::uri] equals "$maint_prefix" } {
HTTP::respond 200 content $static::maint_page "Content-Type" "text/html" "Connection" "Close"
return
}
if { [active_members [LB::server pool]] < 1 } {
HTTP::redirect $maint_prefix
}
}
}
pool is down
[root@ve10:Active] config b pool foo|grep -i pool\ member
+-> POOL MEMBER foo/200.200.200.101:80 inactive,down
bigip responds maintenance page instead
[root@ve10:Active] config curl -iL http://172.28.19.252
HTTP/1.0 302 Found
Location: /maintenance.html
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
HTTP/1.0 200 OK
Content-Type: text/html
Server: BigIP
Connection: close
Content-Length: 80
Sorry! This site is down for maintenance.