falooda_281506
Nov 09, 2016Nimbostratus
irule redirect
I have an existing irule i want to modify for everything that goes to the /net2 uri should be https. We currently have two VS for this (80 and 443). I am having difficulty redirecting *error too many redirects. What is the best place to add this in the irule so that anything that goes to /net2 redirects from http to https?
Below is an example of the irule:
when HTTP_REQUEST {
set my_uri [string tolower [HTTP::uri]]
set my_host [string tolower [HTTP::host]]
if {[string tolower [HTTP::uri]] contains "/flowers"} {pool Flower_POOL}
elseif {[HTTP::uri] contains "/net1"} {pool NET_ALL_POOL}
elseif {[HTTP::uri] contains "/net2"} {pool NET_ALL_POOL }
elseif {[HTTP::uri] contains "/net3"} {pool NET_ALL_POOL }
elseif {[HTTP::uri] contains "/fruit"} {pool Flower_POOL}
elseif {[HTTP::uri] contains "/candy"} {pool Flower_POOL}
elseif {[HTTP::uri] contains "/APACHE7/" } {node 10.1.1.8 7}
elseif {[HTTP::uri] contains "/APACHE8/" } {node 10.1.1.8 80}
elseif {[HTTP::uri] contains "/APACHE9/" } {node 10.1.1.9 80}
elseif {[PROFILE::exists clientssl] == 0 } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
elseif {[string tolower [HTTP::uri]] contains "/testweb/"} {pool TESTWEB_POOL}
else {pool SERVER_TEST_POOL}
}