We have 2 Web servers in Azure that are Load balanced.
We just installed SSL in our these azure websites to convert it to HTTPS.
Now we want that any request coming in as HTTP should be changed/redirected to HTTPS connection.
So, I for testing I created a published website on my local machine, then added self signed
SSL certificate to get a secure site. Then I used URL rewrite to direct my HTTP site to HTTPS.
I used this in Web.config.
This works perfectly on my local published site.
But this fails on the Azure server and gives me an Internal Server Error.
Any ideas?
I used the following in Web.config for the URL rewrite
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="Off" />
<add input="{REQUEST_METHOD}" pattern="^get$|^head$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" />
</rule>
</rules>
</rewrite>
What I have tried:
Tried URL Rewrite in Web.Config .
It did not work on Azure Server.