Forum Discussion

Parveez_70209's avatar
Parveez_70209
Icon for Nimbostratus rankNimbostratus
Dec 11, 2014

Maintenance/sorry page with image on v11

Hi Kevin,

 

Was referring the below F5 link:

 

https://devcentral.f5.com/questions/maintenance-sorry-page-with-image-on-v111

 

and based on that tried edited the format in mine bt failing, can you suggest here please.

 

Thanks and Regards PZ

 

  • Basic maintenance page:

    when HTTP_REQUEST {
            if { [active_members [LB::server pool]] < 1 } {
                    HTTP::responsd 200 content "Down for maintenance"
            }
    }
    

    So if you want to serve up an image with a basic maintenance page, it gets a bit trickier. What I do is upload the HTML for the maintenance page and the image as iFiles and reference them in the iRule. For example, if I have a page that says "Sorry! Down for maintenance!" and has an img tag that calls for "myimage.jpg", I upload both to the F5 and convert them to iFiles, and change my iRule to something like this:

    when HTTP_REQUEST {
            if { [active_members [LB::server pool]] < 1 } {
                    switch [HTTP::uri] {
                            "/myimage.jpg" { HTTP::respond 200 content [ifile get "myfile_jpg"] }
                            default { HTTP::respond 200 content [ifile get "maintenance_html"] }
                    }
            }
    }