Forum Discussion

heskez_36146's avatar
heskez_36146
Icon for Nimbostratus rankNimbostratus
Nov 28, 2013

Maintanance Irule two issues

Hi there,

We've build a cool maintanance Irule (With your help much appreciated)

when HTTP_REQUEST {
    switch [HTTP::uri] {
        "/index.css" {
            HTTP::respond 200 content [ifile get index.css] "Content-Type" "text/css"
        } 
        "/logo.gif" {
            HTTP::respond 200 content [ifile get logo.gif] "Content-Type" "image/gif"
        }
        default {
            HTTP::respond 200 content [ifile get error.html] "Content-Type" "text/html"
                            return 0
        }
    }
} 

This seems to work fine but there are several issues though. The first issue, and that's why I've put the "return 0" in, is the combinantion with multiple Irules. Allthough I've put the return 0 in, I still see (In the logging) the next Irule is being hit and therefore the maintanance doesn't show. So I have to remove all irules from the VS and just put the maintanance Irule on Why?

The second issue is for example I put the maintanance on a VS which listens to www.x.com So when I type www.x.com the maintanance page shows up. But for example when I type in www.x.com/something , the maintance text shows up but the images aren't shown. I would like to see the images when I type www.x.com/something. Is there a way to optimize this Irule to achieve this?

21 Replies