cancel
Showing results for 
Search instead for 
Did you mean: 

iRule to redirect https active/standby site per monitor

Mike_Burrows
Nimbostratus
Nimbostratus

Hello,

I am bringing up a new environment that is just a simple redirect. However they have a standby site that should only be used in the event the first one goes down. I'm not much on writing script and usually pilfer your work on this site and modify for my needs. I haven't been able to find anything that fits this scenario. I can set this up easy enough using a priority group but my mgmt doesn't want all the traffic for this site going through the LTM, just redirect and go. If the first site fails it will just start redirecting to the second. Here is the just of it:

 

site.junk.com (F5 VIP) -> 302 redirect to https://site1.junk.com IF that fails fhen 302 redirect to https://site2.junk.com

 

I usually do something like this for a redirect:

 

when HTTP_REQUEST {

if {

 [HTTP::uri] equals "" or [HTTP::uri] equals "/"}{

HTTP::redirect "https://site1.junk.com"

}

}

 

Somehow I need monitor both site1 and site2 while always redirecting to site1 when both are health. If site1.junk.com then it will automatically start redirecting to site2.junk.com.

 

Thanks in advance for any input.

Mike

 

0 REPLIES 0