Maintenance Page in case of pools failed

From Tech-Wiki
Jump to: navigation, search

Back to iRules

when LB_FAILED {
   HTTP::redirect "http://domain.com/maintenance-mode/"
}

Or below

when HTTP_REQUEST {
   # Check if the VS default pool has any active members
   if {[active_members $default_pool]}{
       pool $default_pool
   } else {
       pool sorry_pool
   }
}

For Priority group use below instead

when CLIENT_ACCEPTED {
     if { [active_members -list http_pool] >= 2 } {
       pool http_pool
     }
}

Or below

when HTTP_REQUEST {
 if { [active_members [LB::server pool]] < 2 } {
  if { not ([HTTP::uri] starts_with "/SecureServer") } { 
    HTTP::uri /SecureServer[HTTP::uri] 
  } 
 } 
}