Forum Discussion

spetrof5's avatar
spetrof5
Icon for Nimbostratus rankNimbostratus
Oct 14, 2022

Maintenance page with an image using iRule and iFile, image never gets displayed

Hello,

Having an issue getting image to display...Have created an iFile and selected an image previously uploaded, iRule calls for that file, however, image never displays, only text.  Any assistance would be greatly appreciated.
Used following article as a starting point:
https://community.f5.com/t5/technical-forum/solution-create-a-f5-maintenance-page-with-image-irule-ifile-a/td-p/243434

when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1 } {
switch [HTTP::uri] {
"/maintenance.png" {HTTP::respond 200 content [ifile get "maintenance.png"] "Content-Type" "image/png" }
default {HTTP::respond 200 content
{ www.website.com is currently in maintenance, sorry for any inconvenience.
}
}
}
}
}

I have tried specifying /Common/maintenance.png, still no show.
When I browse the file system, that image is actually under:

/config/filestore/files_d/Common_d/ifile_d/Common:maintenance.png_62680_1

Many thanks in advance.