Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

F5 Maintenance Page iRule produces ERR_CONNECTION_RESET in browser

RomaineShultz
Nimbostratus
Nimbostratus

We have an F5 LTM that uses a simple iRule that puts up a maintenance page. It has worked fine for years - until we updated from to BigIP 15.1.5.1 (from 15.1.5.0). Now when we implement the iRule, the browser usually produces an ERR_CONNECTION_RESET error. By "usually" I mean if we refresh over and over, it will occasionally work. The iRule is simple:

when HTTP_REQUEST {
   HTTP::respond 200 content \
    "<HTML><head><title>Maintenance Page</title></head><body>
     <p>This site is down for planned maintenance.
     <br>If you need further assistance, 
     please contact the Service Desk."</p>
     </body>
     </html>" "Content-Type" "text/html"
}

I did some research and found a couple of suggestions to try, but they have not helped. I believe it's something specific to the HTTP::respond content method.

This seems like a straightforward iRule. Are We missing something here? Thank you in advance.

Edited by @Leslie_Hubertus to remove SEO spam. Banning the user but leaving the post up because of the helpful answers below.

8 REPLIES 8

AlexBCT
MVP
MVP

Hi Romaine, 

It seems that there is an uneven number of " in the iRule? (or is that due to copy/paste?) There is an extra " behind ...Service Desk." which may be causing issues? 

If you are using quotes within the HTML response page, you may want to switch to using { and } for the start and finish of the HTTP::respond, this should avoid the confusion between the " entries. 

Hope this helps. 

Same question was here from another user which got deleted. So here my answer again:

You got a syntax error: Instead of using " "after the HTTP::respond Command for html code you should use { } This is also explained in the iRule documentation if you mouseover at "http::respond" in the irule editor. 

HTTP::respond 503 content {
<html>
PUT UR CODE HERE
</html>
}

 

enthuguy
Nimbostratus
Nimbostratus

Hi,

How can we automate this F5 Maintenance Page configuration during a planned outage pls?

thanks

Do you mean how the maintenance page can be automatically triggered during an outage, or how to deploy the configuration for the maintenance page automatically? 

In the first case, you could for example do it using the Fallback Host option in an HTTP profile, which then redirects to a virtual server with something like the above iRule attached to it. In the second case, you are able to do it using iControl.

If you tell me which one you are looking for, happy to give you some further information. 

 

Thanks Alex!

If you could guide me in both the scenarios, that would be a great help

Please note, I'm new to F5 but since I'm part of automation team would like to assist my team to automate these manual steps we follow right now.

Current process that we follow:

  1. Just before outage 
  2. From F5 Console, Identify the current iRule configured, make a note
  3. We update the iRule with outage page related rule.
  4. Once implementation is over
  5. Update iRule back with Step2 rules.

Intended automation

  1. Automation script should get the LB name as an argument
  2. Perform above current process steps 2 and 3
  3. Once implementation is over
  4. Will rollback the change

Thanks in advance

 

 

 

Is there better way to achieve this? 🙂

I think the following might do what you're looking for; https://my.f5.com/manage/s/article/K14702105

You can add this to any existing iRule, or just add it as a separate iRule to any eligible Virtual Server. This also means you don't have to worry about updating anything when you notice outages happening/will be happening soon and no further automation needed. 

If you'd rather have a bit more elegant outage page, you can also replace the HTTP::respond command with an HTTP::redirect and send the user to a completely separate web server for a better page. 

Hope this helps. 

Thanks Alex, much appreciated!