iRules Recipe 4: Static Maintenance Page
The Problem
You wish to provide a static maintenance splash page when all members of a pool serving a Virtual Server are currently down or disabled.
The Configuration
# cat /var/tmp/splash-...
Updated Jun 06, 2023
Version 2.0VernonWells
Employee
I am an F5 Solutions Architect for Service Providers in the Americas, focusing on Virtualization, SP protocols (Diameter, GTP, DNS) and programmability.
Prior to joining F5, I worked as a Wi-Fi Network Engineer for a large U.S. public University, as an Operations Engineer, a network management Software Engineer, and as a Technical Trainer.VernonWells
Employee
Sep 25, 2018The ifile is sourced from a regular file, so yes, you can have any arbitrary content in the file. If you use an embedded image (i.e., a base64 encoded version of the data directly in the HTML file), there is no issue at all. If you have referenced files (e.g.,
in your splash HTML page), then you must handle incoming requests for that file in HTTP_REQUEST
, as in:
when HTTP_REQUEST {
switch [HTTP::path] {
"/some/img.png" {
HTTP::respond 200 content [ifile get my-lovely-image.png]
}
}
}