Forum Discussion

static_19526's avatar
static_19526
Icon for Nimbostratus rankNimbostratus
Jul 25, 2012

Adding an image to maintenance page/sorry page

I am looking for a way to bring up a maintenance page/sorry page which included both text and an image.

 

 

We currently have a maintenance page which only displays text but now we would like to include the company logo.

 

 

To bring up the maintenance page we manually change the iRule from eg_example to eg_example_offline.

 

 

The current eg_example_offline looks like this;

 

(see attachment call "eg_example_offline.txt")

 

 

I have read through the forum and found that I need to do the following;

 

 

The base64 encoded images are stored as a Data Group string. (You can convert your images into a base64 encode the image at http://www.motobit.com/util/base64-decoder-encoder.asp ) To put the images into the F5 just go to "iRules", click "Data Group List", and then click the "Create" button. Enter the name (i.e. "bubbles_image_class" or "bandground_class"), make the type as string, and then paste the Base64 encoded string into the "String" textbox. Click Add and then click Finish.

 

 

My problem is.... how do I incorporate the newly added image to my current iRule, eg how do I modify my existing iRule to display the image called "logo" I just added to the "Data Group List"

 

 

I am new to F5 and do not know any programming languages, any help would be great!

3 Replies

  • Hi,

     

     

    about time I gave back to this wonderfull community. Now I am not saying this is the best way of doing things, and it doesn;t actually answer your original quastion, but it is an alternative method of acheiving what you want and without the need to swap in/out iRules. In fact there is no iRule change required at all which is what I like obout this solution. All I will say is that it works quite well for our environment.

     

     

    Essentially we have a IIS server that hosts our maintanence and site down pages. The IIS server is in it's own pool and has a health monitor so it can be correctly detected as being up/down.

     

     

    When we need the maintanence page up we simply start the IIS virtual web server and the iRule code detects this and then pools all traffic off to the IIS box. When the maint period is over we simply stop the IIS virtual server and the iRule code detects this and allows the traffic through.

     

     

     

    So, what we have is this

     

     

    1. An IIS box which servers our maintenance page.

     

    2. A pool which contains this IIS server

     

    3. A working health monitor

     

    4. I iRule that does a member check on the IIS pool and if the acitve member count is 1 or more then we divert to the maint page. If the count is less than 1 then let the traffic through.

     

     

    We also do some IP filtering as well so internally our developers can access and test the site before allowing access to the public. We do this by habing a data group containng the network addresses of our internal systems. The iRule then checks to see if the clients remote address is one of our internal address or not, and if not then they get the maint page.

     

     

    Here's the bit of code from our iRule.

     

    If bookedmarked pages are used, for a redirect to / because the holding page does not have

     

     

    set raddr [IP::client_addr]

     

     

    if { [active_members Prod_Holding_Page] >= 1 && not [class match $raddr equals Internal_IPs ] } {

     

    pool Prod_Holding_Page

     

    return

     

    }

     

     

     

    where Internal_IPs is the data group containing the list of internal IP addresses/networks.

     

     

     

    We do a similar test to automatically display our sitedown page, without the IP restirctions. Basically if all pool members are down in our webserver pool then we pool to the IIS virtual server hosting the site down page.

     

     

    Of course you could just do HTTP::redirects instead of pools. Our requirememt was that we had to maintain the web address, so using pools seemed the logical way to do it.

     

     

    I am sure there are many approaches to this, this is just mine. I hope it is of some use to you.

     

     

    Regards,

     

     

    Craig

     

     

     

     

     

     

     

     

     

     

     

     

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus
    In response to Craig's post I wonder if this was easier:

     

     

    Add your IIS server hosting the maintenance page to the pool associated with the virtual server. Then setup Priority Group Activation so this pool member is only used with the other pool member(s) are down. Once one or more are back up then this server is once again ignored. This saves iRules and if you want to manually enter into a maintenance period you only need to disable the pool members.

     

     

    Hope this helps,

     

    N