Hello,
This devcentral article is quite old. You have new options now. here is a little example :
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
display maintenance page if no pool members are available
when HTTP_REQUEST {
if { [active_members $default_pool] < 1 } {
HTTP::respond 200 content [ifile get "/Common/maintenance.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
}
}
how to offload backend server error messages
when HTTP_RESPONSE {
if {([HTTP::status] starts_with "404") } {
if { !([class match $method equals "http_method"]) } {
HTTP::respond 404 content [ifile get "/Common/404.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
}
}
}
display maintenance page when load balancing fail
when LB_FAILED {
HTTP::respond 200 content [ifile get "/Common/maintenance.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
}
You just have to upload your maintenance page as an ifile. here the link to ifile description : https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/bigip-system-irules-concepts-11-6-0/7.html?sr=53648987