Forum Discussion

AlanRod's avatar
AlanRod
Icon for Nimbostratus rankNimbostratus
May 24, 2019

How to display maintenance page when server is down (redirect web traffic)?

Good day,

 

For a specific client we require, from the BIG-IP side, to redirect/show a maintenance page while a server(node) is unavailable. I found this article which I think it could help us https://devcentral.f5.com/questions/http-redirect-when-pool-is-down but it does not load, I get an HTTP 404 response.

 

General detail for scenario:

 

  • We only have ASM and LTM modules.
  • We are running BIG-IP version 13.1.
  • We have multiples servers protected by our WAF, so we need probably an iRule to display/redirect a custom HTML page while a specific node is down instead of not loading web content.

 

If there is another way besides an iRule we would also appreciate it and would like to try it.

If the only way is through an iRule what would be the appropriate syntax?

3 Replies

  • Try below iRule, which will you to solve issue.

    when LB_FAILED {
    if { [active_members POOL-NAME] < 1 } {
    # Log and direct the client to Maintenance Page
    HTTP::respond 200 content {
          <html><head><title>Apology Page</title></head><body>
    <center>    We are sorry, but the site you are looking for is temporarily under maintenance.<br>
                ----------- <br>
                Please try after sometime or contact your system administator</center> 
             </body></html>
                     }
             }
    }

    • AlanRod's avatar
      AlanRod
      Icon for Nimbostratus rankNimbostratus

      Good day Samir,

       

      Thanks for your help.

       

      We used the iRule and changed "POOL-NAME" with our client's Pool, applied the iRule to our client's Virtual Server but when disabling our client's Node (for testing purposes) the Apology Page does not load. Is there something we are missing?

      • Samir's avatar
        Samir
        Icon for MVP rankMVP

        Just forcefully disable node. It will work..​