Maintenance Page in case of pools failed

From Tech-Wiki
Revision as of 19:45, 20 May 2019 by Fabricio.Lima (Talk | contribs) (Created page with "Category:F5 Networks '''Back to iRules''' when LB_FAILED { HTTP::redirect "http://domain.com/maintenance-mode/" } Or below when HTTP_REQUEST {...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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] 
  } 
 } 
}