Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Redirect HTTP to HTTPS in Azure (With Load Balancer)

Posted on 2016-10-11
2
Medium Priority
?
177 Views
Last Modified: 2016-10-14
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>

Open in new window

0
Comment
Question by:Arikkan
2 Comments
 
LVL 29

Accepted Solution

by:
Dan McFadden earned 2000 total points
ID: 41841961
Microsoft article on how to setup SSL offload.

Link:  https://azure.microsoft.com/en-gb/documentation/articles/application-gateway-ssl-arm/

Dan
0
 

Assisted Solution

by:Arikkan
Arikkan earned 0 total points
ID: 41843942
Your solution did not work.

But I figured it out. I was missing the URL rewrite module on IIS on the server. Installing that did the trick

https://www.iis.net/downloads/microsoft/url-rewrite


Now the IIS server can redirect the url requests from HTTP to HTTPS :-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question