You could solve your problem with httpclass Profiles or iRules, do you have a preference?
iRule Method:
On your HTTP Virtual Server, modify your HTTP to HTTPS Redirect iRule to look at the [HTTP::uri] before it takes any action. If “/uri1” redirect, if “/uri2” or “/uri3” send to the server pools for each.
On your HTTPS Virtual Server, apply the reverse logic of the previous iRule.
If you want to combine them into a single iRule you can do that as well using the “if {[TCP::local_port] == 443 }” approach and separate the logic. Also, make sure you have a default action (I assume that you would want the default action to perform an HTTP to HTTPS redirect to somewhere).
httpclass Method:
Each httpclass can match on the Host and/or URI Value. You can create the same type of logic used in the iRules to serve the same purpose.
httpclass1 = On HTTP Virtual Server detect “/uri1” and perform a redirect.
httpclass2 = On HTTPS Virtual Server detect “/uri2” and redirect to HTTP.
httpclass3 = On HTTPS Virtual Server detect “/uri3” and redirect to HTTP.
You could create a final httpclass to apply on your HTTP Virtual Server to perform a generic HTTP to HTTPS Redirect (just make sure it is the final httpclass in the stack (once an httpclass matches it will process the request and not process any further httpclasses).
I tried it frist with the httpclass Method but it wasn’t successfull. Not sure where the Problem was. Troubleshotting seems to me very difficult to find the Problem.
So I startet with iRules.
This works so far great but there one last Problem:
But the Problem is the from the Client side is must keep https. How do I terminate the https and go with http to the two Servers?
Terminating the ssl has to be done with the ssl Profile but how do I have to configure it that I am able to choss between http and http from the LTM to the webserver?