Forum Discussion
falooda_281506
Nimbostratus
Nov 09, 2016irule 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...
David__Pasch
Altostratus
Nov 09, 2016I agree with Odaah. Two rules would be the way I would address this. It would be easier to own and account for the contexts as they move to 443, assuming that is on everyone's roadmap at this point. 🙂
With that said, I think adding a line above your /net2 line with a nested conditional will work. I was unable to test this so, YMMV.
Good Luck!
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" and [TCP::local_port] equals "80" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
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}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects