Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

maintenance iRule with 404

F5workuserguy
Altostratus
Altostratus

is there a better way to write this?\

 

=====================================================

when LB_FAILED {

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

} else {

    HTTP::fallback "https://maintenance.google.com"

  }

}

when HTTP_RESPONSE {

  if { [HTTP::status] == "404" } {

    HTTP::respond 302 noserver Location "https://maintenance.google.com"

  }

}

=====================================================

1 REPLY 1

Hello F5workuserguy.

Try this:

when HTTP_REQUEST {
  if { [active_members [LB::server pool]] < 1 } {
    HTTP::respond 302 noserver Location "https://maintenance.google.com"
  }
}
 
when HTTP_RESPONSE {
  if { [HTTP::status] == "404" } {
    HTTP::respond 302 noserver Location "https://maintenance.google.com"
  }
}

Regards,

Dario.

Regards,
Dario.