Forum Discussion

Mike_Easdon_615's avatar
Mike_Easdon_615
Icon for Nimbostratus rankNimbostratus
Feb 02, 2009

Advice on out of service pages

hello,

 

 

I have a conundrum with maintaining the out of service pages that serve our web sites when they are, well, out of service.

 

 

BigIP has the following configuration (basic description I know)

 

 

Virtual server for www.oursite.com

 

Pool with four members for www.oursite.com

 

 

The pool consists of the physical servers housing the web pages; two nodes are the site itself on the respective servers, two nodes are the out of service pages on the respective servers.

 

 

I activate the out of service pages by disabling two nodes (physical site) and enabling the other two (OoS pages)

 

 

I’ve noticed that the out of service pages only serve the root URL ie www.oursite.com and not a sub pages with the site ie www.oursite.com/member1

 

 

I’m not looking for the solution but more of a pointer in the right direction to ensure that regardless of the URL, any hit within www.oursite.com is redirected to the correct out of service page.

 

 

Thank you

 

6 Replies

  • A generic rule like this would work fine:

     
     when HTTP_REQUEST { 
        HTTP::redirect "http://www.oursite.com" 
     } 
     

    but it would have to be manually added to the vip whenever you took the primary nodes out of service.

    So, something a little more elegant might be to use a 2 statements like this (with an AND):

     
     if { [LB::status pool  member  ] eq "down" } 
     

    where you hardcode the pool name and the primary nodes' IP's and ports into the and sections. That's of course assuming that those nodes don't change. Then when the iRule detects that you've disabled the primary nodes, it should begin doing the redirect.

    I'm having a hard time thinking of anything more portable than that...

    Denny
  • I'm also assuming you're using priority groups within the pool...

     

     

    Denny
  • Another possible approach is this:

    1) Create two pools: one with your real site, the other with your splash page.

    2) Create a simple iRule to check the member count of your primary pool. If your nodes are down, select your splash page pool and reset the URI to "/".

    Something like this (untested, unchecked for typos, etc.) may work:

     
      
     when HTTP_REQUEST { 
       if { [active_members primary_pool] < 1 } { 
        
       Your primary members are unavailable, so crop the URI and select splash page servers 
       HTTP::uri "/" 
       pool splash_pool 
      
       } 
     } 
      
     

    Good luck!

    -Matt
  • These are both great suggestions and I thank you both for your contribution. I'll test both methods and post back the results. Thank you once again.

     

     

    Mike
  • If the maintenance page contains references to other objects (like images or css, etc) you could rewrite the URI only if the request is to a page that hasn't been rewritten already. You would want to use a path and page that does not exist in the application already:

      when RULE_INIT {  
      
          Use a prefix for the path that does not already exist in the application  
         set ::maintenance_prefix "/maintenance/"  
      
          The default maintenance page  
         set ::maintenance_page "maintenance.html"  
      }  
      when CLIENT_ACCEPTED {  
      
          Save the name of the default pool on the VIP  
         set default_pool [LB::server pool]  
      }  
      when HTTP_REQUEST {  
      
          Check if there aren't any active members in the default pool  
         if { [active_members $default_pool] < 1 } {   
      
             Primary members are unavailable.  Check if the URI has not already been rewritten.  
            if {not ([HTTP::path] starts_with $::maintenance_prefix)}{  
      
                Rewrite the URI to the maintenance prefix/maintenance page (/maintenance/maintenance.html)  
               HTTP::uri "$::maintenance_prefix$::maintenance_page"  
            }  
             Use the maintenance pool  
            pool splash_pool 
      
         } else { 
      
             Use the default pool  
            pool $default_pool 
         } 
      } 
     

    Aaron