Forum Discussion

juhiverma17_320's avatar
juhiverma17_320
Icon for Nimbostratus rankNimbostratus
May 09, 2017

Sorry Page when all the pools associated with the Application is down

I have a query here. The irules works when your default pool is down. I.e it displays sorry page for the main URL. I've many L7 URI pools in my application, So the requirement is that for every URI also it should display the sorry page.

 

i.e if the main URL is https://abc.apple.com and it has a L7 URI for /payment which which I've different set of nodes.

 

I want the even https://abc.apple.com/payment should also display the sorry page when the URI pool is down.

 

Can someone suggest what should be the if condition, to take in account all pools of an application?

 

7 Replies

  • Can you share the iRule that you have set? Maybe with the iRule shared out, people can take a look and see why it's not working for all URIs. Thanks!

     

  • From this thread:

        when LB_SELECTED {  
        if { [active_members [LB::server pool]] == 0 } { 
            HTTP::respond 200 content "  
    
                 
    
            " 
        } 
     } 
    
  • The if condition applied is:

     

    when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 }

     

    I dont have the Irule handy now.. just sharing the condition part

     

  • See the iRule from Vijay below...looks like the condition is "when LB_Selected" rather than "when HTTP_Request"

     

  • This is the Irule I'm using:

     

    when HTTP_REQUEST { if {[active_members [LB::server pool]] == 0} { switch [HTTP::uri] { "/h_abc.gif" { HTTP::respond 200 content [ifile get "h_abc_gif"] } "/" { HTTP::respond 200 content [ifile get "maintenance_wo_closebtn"] } } } }

     

    This sorry page is a HTML page with images embedded.

     

    I tried to replace the when HTTP_Request with when LB_Selected but it gives error. 01070151:3: Rule [/Common/user-maintenance_rule] error: /Common/user-maintenance_rule:4: error: [command is not valid in current event context (LB_SELECTED)][HTTP::respond 200 content [ifile get "h_abc_gif"] ]