_ni-la
Last Updated: February 25, 2016
·
2.201K
· bretterer

Rackspace Load balancer with SSL Termination for IIS HTTP -> HTTPS Redirect

A quick guide on setting up a redirect from http to https when using a Rackspace Loadbalancer with SSL Termination set up. This guide shows you how to use the URL Rewrite Module that is available with the Web Platform Installer.

Step 1.

Open your IIS install and make sure URL Rewrite Module is installed. Do this by looking for "Web Platform Installer" in the Management Section of the site you need to rewrite. Picture

Search for "URL" once that opens and make sure URL Rewrite is installed.

Picture
If it is not click add to install it then restart IIS manager.

Step 2.

Once URL Rewrite is installed, Double click on it from within the site in the IIS manager
Picture

Then Click on "Add Rule"
Picture

Step 3.

Create a blank rule
Picture

Step 4.

Title your new inbound rule something to let you know what it does. Set your Match URL settings with Requested URL matching the pattern using Regular Expressions and the pattern (.*) as this will match anything
Picture

Step 5.

Create a new condition.
The condition Imput should be {HTTPXFORWARDED_PROTO} which comes from the Rackspace Load balancer.
Selected "Does not match the pattern" and make the pattern https.

Special Note

If you want to make sure you never use https, anywhere I say http or https, just switch it.

Picture

Step 6.

The last thing to do is set the action, You want to make it a redirect rule where it takes you to the url https://{HTTP_HOST}/{R:1} with the redirect type 301 permanent.

Picture

Save your rule and you are done.