Forum Discussion

Mike_Burrows's avatar
Mike_Burrows
Icon for Nimbostratus rankNimbostratus
Jul 01, 2020

iRule to redirect https active/standby site per monitor

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

 

No RepliesBe the first to reply