Forum Discussion
Maintenance Page Needed.
Something like this is probably still your best bet:
https://devcentral.f5.com/wiki/irules.automatic_maintenance_page___sorry_page_with_images.ashx
Except that you don't really need to keep the images in base64 anymore. You can upload the raw images into iFiles and call them directly. You can also store the base64-encoded images in an internal or external data group and use the 'class' command to fetch them. The below is a modified example using iFiles.
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1 } {
if { [HTTP::uri] ends_with "logo.png" } {
HTTP::respond 200 content [ifile get logo] "Content-Type" "image/png"
} elseif { [HTTP::uri] ends_with "background.png" } {
HTTP::respond 200 content [ifile get background] "Content-Type" "image/png"
} else {
HTTP::respond 200 content "HTML blocking page content"
}
}
}
So basically, your HTML document is going to include image directives (src tags), which should include relative URLs (ex. "./logo.png"). When all pool members are down, the first action will be to send the HTML page (the else condition). The browser will then make separate requests for the embedded src tag images, which the above iRule will respond with.
You could also technically embed the images directly into the HTML document using "data:image/png;base64" syntax. See https://varvy.com/pagespeed/base64-images.html for a good reference. In that case you'd just need a single, albeit large, HTML file to send.
Recent Discussions
Related Content
* 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