logicmyfoot_269
Aug 31, 2016Nimbostratus
Exclude a Specfic url from https re-direction from _sys_https_redirect F5 supplied rule
Hi,
I am new F5 LTM world and have just begun playing with iRules ; In my F5 lab i am using the F5 supplied Rule to redirect all http traffic to https as follows:
when HTTP_REQUEST {
{ [HTTP::redirect] https://[getfield [HTTP::host] ":" 1][HTTP::uri] }
}
What i want to achieve is serve a url from both the HTTP VS and HTTPS VS without having to removing the "_sys_https_redirect" rule from the HTTP VS. So if go request only http://abc.com i should be served from HTTP VS and not re-direct to HTTP VS i tired to add a "NOT " operator to skip HTTPS re-direction when HTTP::host matches a test url as follows:
when HTTP_REQUEST {
if {[HTTP::host] not "abc.com" } { pool abc.com_pool }
else { [HTTP::redirect] https://[HTTP::host] [HTTP::uri] }
}
However this does not works. I also tried to add a seprate iRule for abc.com placed above the _sys_https_redirect which also did not work , is there any better/simplified way to achieve this??