Forum Discussion

SL's avatar
SL
Icon for Cirrus rankCirrus
Nov 06, 2017

Maintenance page referencing css and png content

Hi All

 

I have the following iRule, that calls a html page when HTTP_REQUEST {

 

if { [active_members [LB::server pool]] == 0 } { HTTP::respond 200 content [ifile get F5-test3] } }

 

The issue I am running into is that the F5-test3 file is a html file that has references to png and css files in the following format:

 

  • There are two ways :

    1- Add a few lines into your iRule to reponse to all request of all parts of the Maintenance Page. Like This:
    switch -glob [string tolower [HTTP::uri]] {
        "/css/bootstrap.min.css" {HTTP::respond 200 content [ifile get bootstrap-css]}
        "/css/f5.min.css" {HTTP::respond 200 content [ifile get f5-css]}
        "images/product_grey.png" {HTTP::respond 200 content [file get product-image]}
    }
    

    2- Add all parts of the Maintenance Page into the page. In other words, combine all parts, copy and paste content of your css files into your Maintenance Page header, and convert your image base64(online converter is here) and paste it into your page.

  • P_K's avatar
    P_K
    Icon for Altostratus rankAltostratus

    May be you could try something like this..

     

    when HTTP_REQUEST {

     

    switch -glob [string tolower [HTTP::uri]] {

     

    "/" { HTTP::respond 200 content [ifile get "maintenance.html"] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate" }

     

    "/images/logo.png" { HTTP::respond 200 content [ifile get "logo"] }

     

    "/images/maintenance.png" { HTTP::respond 200 content [ifile get "maintenance"] }

     

    "/css/page.css" { HTTP::respond 200 content [ifile get "page.css"] noserver "Content-Type" "text/css" "Cache-Control" "no-cache, must-revalidate" }

     

    }

     

    }