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
Joined August 23, 2012
VernonWells
Sep 25, 2018Employee
The 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]
}
}
}