This is not a question, I’m just putting this out here to help people who have run into this problem.
Before 11.4, you could easily redirect from HTTP to HTTPS using HTTP Classes. In 11.4, HTTP Classes are no longer present, and there is not yet a solution article published showing how to accomplish the same thing using Local Traffic Policies. You should be able to get by with this for now.
First, you need to Create a policy with the matching strategy of your choice, I chose “best-match”. Chose a name for the policy.
This policy should require “http”, and control “forwarding”.
You can then add a rule. Choose a name for the rule
For the rule conditions, leave the defaults in (empty conditions list).
For the actions, the target should be “http-reply”, the event should be “request” and the action “redirect”. You will have the location parameter available to you. Set the value to :
Click “Add” for the parameter, then “Add” again to add the action to the list of actions.
Click Finished once done, and then you can attach this policy to the virtual server of choice, and it should redirect all requests to the HTTPS equivalent of the incoming host and URI combination.
Thank you for this. “How to redirect HTTP to HTTPS without an iRule now that HTTP Class Profiles are gone” was difficult to find. How can I make it close the connection afterwards? I have tried everything I could think of, but I always get “Connection: Keep-Alive”, and that’s not what I want when redirecting the browser to a different TCP port. I tried adding another Rule (all-match strategy on the policy, no condition, http-header response replace / insert name=Connection value=close) to the policy, but it had no effect. I tried using an HTTP Profile that had “Maximum Requests: 1” (and even HTTP 1.1 Pipelining disabled), but it still let me request over and over on the same connection, still said Connection: Keep-Alive, and still redirected me.
In v11.6.0, the old HTTP profiles are still there, such as /Common/http, and other customised child ones, retained by the upgrade process. It’s just that they no longer appear in “Local Traffic” → Profiles → Services.
I would like to replicate the function of “Redirect Rewrite” that used to be in the old HTTP profile and it seems that I need to create a rewrite profile instead, not really a “traffic policy” as mentioned above.
Can somebody clarify all this? The solution articles I can find are all about how the old profiles cannot be brought into v11.4.0+ versions for various reasons; there are no specific examples to show how to do it in the new way, and why (to ust say “HTTP class is no longer available” is not that much helpful.)
I’m on version 11.5.3 and I still don’t see the option to change the response to a 301 instead of 302 in the LTM policies. Does anyone have a solution for that yet?
Come to think of it, the whole point of using a policy for this is to remove the need of programming, i.e. having to have someone to write irules, apart from for better performance. Another benefit of that would be more robustness for automation.
Apparently there’s still way to go to achieve that.
Don’t get me wrong, though, for I love programming myself.