Yesterday I had to configure Fortinet ADC device for Microsoft Exchange loadbalancing and with very limited knowledge of this platform I got stuck on HTTP to HTTPs redirection setup. I used the following article to setup up Virtual Servers but there were no specific configuration on how to setup HTTP redirect.
There are two ways to rewrite HTTP to HTTPs header. One is with Content Rewrite rule and the second is with Scripting.
Content Rewrite will require a bit of work. First, create a rule based on this article.
Go to Server Load Balance > Content Rewriting > Add
Give it a Name > for Action select Redirect > populate Redirect Specifics and Match conditions as shown below > Save new rule.
If you decide to accomplish this with scripting it is easier as the script is already created. You can verify it under Server Load Balance > Scripting.
Now the tricky part is creating Virtual Server.
Virtual Server needs to be type Layer 7 (any other type will not give you option to rewrite content or execute the script).
Add new Virtual Servers under Server Load Balance > Virtual Server > Add > Advance Mode.
Content Rewrite is enabled under Basic > Specifics > add Content Rule you just created.
To use Script enable it in General section of Virtual Server configuration screen and add it to Selected Items. Save configuration.
Once completed HTTP requests will start redirecting to HTTPs.