Forum Discussion

Don_22992's avatar
Don_22992
Icon for Nimbostratus rankNimbostratus
Sep 26, 2008

Maintenance Page iRule

I have the following iRule defined to show a maintenance page when all pool members are unavailable. It works like a champ, with one minor exception. Perhaps someone here has seen a similar situation. This iRule is a resource for a virtual server that uses the pool "beta-manage"; the pool "beta-img" contains other nodes.

 

 

The iRule is:

 

 

when LB_FAILED {

 

LB::reselect pool beta-img-pool

 

HTTP::uri "/images/maintenance/index.html"

 

}

 

 

When the page referred to by the above URI is served, the html displays but the referenced images are missing. The page displays fine if I go to it directly. It is only when it is returned after this iRule fires that I see a problem.

 

 

Am I missing something obvious?

 

 

Thanks,

 

Don

2 Replies

  • Hi Don,

     

     

    I think it's the fact that you're rewriting every URI to the html page in LB_FAILED. So the first request a user makes when the pool is down gets rewritten to index.html as you want it to. But then when the index.html page references images, the client requests those images and the URI again gets rewritten to index.html and the server responds with html instead of the images. The browser won't display the HTML as an image as the text content-type of the response isn't what it expects for an image.

     

     

    I think an ideal solution would be to host the maintenance images on a different VIP and pool, so the LB_FAILED rule wouldn't trigger. Else, if you can't do that, you could potentially check the referer header value to see if it's the maintenance page and not rewrite the URI in that case. The downside to this is the clientside HTTP header info is probably not available in LB_FAILED. So you'd need to save the Referer header value for every request.

     

     

    Aaron
  • Thanks for the prompt reply, which made sense to me. I'll let you know what happens after I get a chance to set up a test scenario.

     

     

    Don