How to specify protocol in iRule
Hello all
I'm trying to swap a pool resource and also protocol in an iRule but not sure how to do this. The environment I have is:
http://www.example.com gets routed to
PRES layer F5 (11.6) VS: 172.16.10.1:80
pool1 Node1: 172.16.15.1:80 Node2: 172.16.15.2:80
pool2 Node1: 172.16.50.1:9443
APP layer F5 (11.6) VS: 172.16.50.1:9443
pool5 Node1: 172.16.55.1:9443 Node2: 172.16.55.2:9443
I have an iRule on the PRES F5 that inspects the URI:
if {([string tolower [HTTP::uri]] starts_with "/logon/")} {
pool pool2
}
The idea is so all logon requests are served by pool5 in the APP layer - there is an SSL cert on each node of pool5. I have had this working OK when the servers are all HTTP and there is no SSL involved.
If I hit https://172.16.50.1:9443/logon/landing.htm in a browser, I get the site OK but I cannot get to the site if I browse to http://172.16.10.1/logon/landing.htm
It's as if the PRES F5 is not performing the SSL handshake like the browser is. Or am I missing something in the iRULE, so when I perform the pool switch, I also need to tell the request to switch to HTTPS?
Any pointers would be great.
Thanks
Tony