Difference between revisions of "Maintenance Page in case of pools failed"

From Tech-Wiki
Jump to: navigation, search
(Created page with "Category:F5 Networks '''Back to iRules''' when LB_FAILED { HTTP::redirect "http://domain.com/maintenance-mode/" } Or below when HTTP_REQUEST {...")
 
 
Line 3: Line 3:
  
 
  when LB_FAILED {
 
  when LB_FAILED {
HTTP::redirect "http://domain.com/maintenance-mode/"
+
    HTTP::redirect "http://domain.com/maintenance-mode/"
 
  }
 
  }
  

Latest revision as of 18:46, 20 May 2019

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] 
  } 
 } 
}