elseif
3 TopicsiRule for directing OWA/OA Traffic
Hey! Total beginner at iRules so hoping someone could point me in the right direction. In summary what I want to do is the following: 1) If a Mac Outlook app comes in (using webmail.company.com/ews/exchange.asmx) > Send to a pool 2) If a request comes in directly to webmail.company.com > Redirect to a different URL 3) If any other request come in (ex. autodiscover.company.com) > Continue to default VIP behaviour Since the domain listed is the same for 1+2 (difference is the URI) I want to make sure that if 1 is hit, 2 is not looked at and sent to the wrong place. So far I have: when HTTP_REQUEST { if {[string tolower [HTTP::uri]] equals "/ews/exchange.asmx"} { pool Exchange_2013_proxy_pool } elseif {[string tolower [HTTP::host]] contains "webmail.company.com"} { HTTP::redirect "https://site.company.com" } } Would this work to satisfy the first 2 conditions listed above? What happens when nothing is matched in this irule (ex. condition 3 where autodiscover.company.com is used)? Does it continue on to whatever the default behaviour is for my original VIP? Any info or tips would be amazing!378Views0likes1CommentIrule with elseif and pool selection
Hello, I'm trying to write an irule that routes traffic to a specific pool based on the host. I think I'm fairly close, but I can't figure out the following error: 01070151:3: Rule [test-pool-selection] error: line 5: [undefined procedure: elseif] [elseif] when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { if { [HTTP::host] starts_with "abc" } { pool ss-devsp3-pool } elseif { [HTTP::host] starts_with "def" } { pool ss-devsp3-pool-81 } elseif { [HTTP::host] starts_with "ghi" } { pool ss-devsp3-pool-82 } } }2.4KViews0likes6CommentsiRule Redirect loop
Hi I am trying to achieve a simple URL redirect but I keep getting a redirect loop or nothing at all. I get an error of "too many redirects" Condition 1 All requests to "; must be redirected to https://test.tst.train123.com/trace123 only But any other traffic eg. "; must continue to the default pool My problem is when I use the the irule below I get a redirect loop when HTTP_REQUEST { if { [HTTP::host] equals "test.tst.train123.com" } { HTTP::redirect "https://test.tst.train123.com/Trace123 [HTTP::uri]" } } When I try this it doesnt seem to work either. I know I am missing something when HTTP_REQUEST { if { [HTTP::uri] equals "test.tst.train123.com"} { HTTP::redirect "/Trace123" } elseif { [HTTP::uri] equals "; } { pool pool_trace123 } }535Views0likes2Comments