Skip to content

Instantly share code, notes, and snippets.

@Ben-Atherton
Created February 8, 2017 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben-Atherton/c79b8bdeeb401689abe632e7cdf2beae to your computer and use it in GitHub Desktop.
Save Ben-Atherton/c79b8bdeeb401689abe632e7cdf2beae to your computer and use it in GitHub Desktop.
How to force HTTPS behind an Amazon Web Services Elastic Load Balancer
<rewrite xdt:Transform="Insert">
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment