Skip to content

Instantly share code, notes, and snippets.

@robert-claypool
Created November 13, 2015 03:28
Show Gist options
  • Save robert-claypool/75995b20bd23280dbd27 to your computer and use it in GitHub Desktop.
Save robert-claypool/75995b20bd23280dbd27 to your computer and use it in GitHub Desktop.
IIS configuration for HTTP to HTTPS redirects behind an AWS Electric Load Balancer; IIS URL Rewrite must be installed.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS rewrite behind AWS Electric Load Balancer rule" enabled="true" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{SERVER_NAME}{URL}" redirectType="Found" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@robert-claypool
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment