Jamesy_105825
Dec 23, 2010Nimbostratus
redirect and sorry server, new to irules
I am trying to write an iRule to redirect to a sorry server where another redirect rule exists. I'm new to irules and I can't seem to wrap my head around the logical flow.
Essentially, I want it to perform the initial redirect, but then redirect to a sorry pool if none are available in that pool. Can I do a nested if statement inside the first one?
Here are some examples of the current redirects (these are both separate iRules):
-=-=-=-=-=-=-=-=-=-=-=-
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/login-test" } {
pool Pool1
}
}
-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-
when HTTP_REQUEST {
if { ( [HTTP::host] contains "hostname.domain1" ) or ( [HTTP::host] contains "hostname.domain2" ) } {
pool Pool2
}
}
-=-=-=-=-=-=-=-=-=-=-=-
Can someone help me understand what I need to do?