Forum Discussion

heskez_36146's avatar
heskez_36146
Icon for Nimbostratus rankNimbostratus
Jun 02, 2016

redirect to particular maintenance webpage during outage webservers

Hi everyone,

 

This subject must have passed some couple of times. I've asked some questions myself about this subject as well. Our situation is not that complex. We use an F5 loadbalancer LTM with HA active/standby setup. There're multiple internet lines connected so therefore we use the LLC module as well. Within a previous discussion I request for a maintenance page redirect in case of an outage of our web servers. Because these web servers share the same pool and profile a solution was found in altering the HTTP Profile properties at this section: Enable fallback host However, when both web servers are unavailable the pool also goes down and the VIP and as a result a 404 error page is being presented to the client's browser. In order to avoid this, when this situation happens, we manually remove all health monitors on the pool so the pool and VIP stays online, then the redirection will succeed. Is there a way, without removing the health monitors manually, to produce the error page no matter what if all systems are down?

 

Best regards, E

 

10 Replies

  • Hello heskez, i just tested that in a 12.1 and with just the fallback host parameter modified on my http profile i'm still redirected when no more pool member available and my vs status is red offline(enable)

     

  • I don't fully understand your question. Did you see the Fallback Mechanism ?

    I am guessing that you are getting a RST from F5 when there are no pool members available but you want to force a redirect to the errorpage. If that be the case, you can try an iRule:

    when HTTP_REQUEST {
       if {[active_members [LB::server pool]] < 1} {
         HTTP::respond Location 301 http://errorpage
    }
    }
    
  • Hi There, thank you both for answering.

     

    @Arnaud: That is the confirmation I am looking for. Since we run version 11.6.0 the fallback host option doesn't work when all pool members are unavailable and the VS goes red. Good to know this will be solved in an upgrade to version 12. A Little bit strange though, is this documented whithin the release notes as a bug fix?

     

    @Odaah: The VIP we're using has already an Irule assigned with a pool selection. When we add this piece of code you suggested. I'm familiar with it, in the past we used this at the bottem of the existing irule, the application becomes unavailable. So we better not mix it with the existing irule. Is it possible to have this piece of code within a separate irule and put it beneath the "master" irule in order to run?

     

  • Hi,

    Based on the irule provided by odaah :

    when HTTP_REQUEST  priority 100 {
       if {[active_members [LB::server pool]] < 1} {
         HTTP::respond Location 302 "http://errorpage"
        }
    }
    

    I changed the 301 redirect to 302. Better if you don't want that the browser redirect you everytime on the error page

    I put priority 100 on the event, you can put a lower priority on the other irule (e.g. priority 500).

    • Yann_Desmarest_'s avatar
      Yann_Desmarest_
      Icon for Nacreous rankNacreous
      and on my side, I never use redirect to display maintenance page. I prefer to reply directly with the maintenance page content using ifiles
    • heskez_36146's avatar
      heskez_36146
      Icon for Nimbostratus rankNimbostratus
      Me too, I use the ifiles as well when a planned maintenance is upcoming. This page is more likely an error page.
  • Hi,

    Based on the irule provided by odaah :

    when HTTP_REQUEST  priority 100 {
       if {[active_members [LB::server pool]] < 1} {
         HTTP::respond Location 302 "http://errorpage"
        }
    }
    

    I changed the 301 redirect to 302. Better if you don't want that the browser redirect you everytime on the error page

    I put priority 100 on the event, you can put a lower priority on the other irule (e.g. priority 500).

    • Yann_Desmarest's avatar
      Yann_Desmarest
      Icon for Cirrus rankCirrus
      and on my side, I never use redirect to display maintenance page. I prefer to reply directly with the maintenance page content using ifiles
    • heskez_36146's avatar
      heskez_36146
      Icon for Nimbostratus rankNimbostratus
      Me too, I use the ifiles as well when a planned maintenance is upcoming. This page is more likely an error page.
  • Hi,

    In general, I replace the redirect by a respond like this :

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