Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

spetrof5
Nimbostratus
Nimbostratus

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-i...

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.

1 REPLY 1

iaine
MVP
MVP

Hi

You need to include some html in your HTTP response to instruct the client to get the image.  Try using a <img src> tag that points at /maintenance.png (https://www.w3schools.com/tags/tag_img.asp)