Skip to content

Instantly share code, notes, and snippets.

@solrevdev
Last active October 7, 2016 10:28
Show Gist options
  • Save solrevdev/8e1de4ce29c4d356c43dc3e91f1d3b71 to your computer and use it in GitHub Desktop.
Save solrevdev/8e1de4ce29c4d356c43dc3e91f1d3b71 to your computer and use it in GitHub Desktop.
A web.config setting for forcing SSL on an IIS website sat behind an Amazon AWS Elastic Load Balancer
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment