Created
February 8, 2017 10:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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