Last active
December 8, 2016 08:30
-
-
Save betimd/2e4f320f89ce8365d094a613374d6801 to your computer and use it in GitHub Desktop.
Asp.Net Core Web Config file to deploy in AWS ElastinBeanstalk that will server requests just in HTTPS (redirect HTTP to S)
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | |
</handlers> | |
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" | |
stdoutLogEnabled="false" | |
stdoutLogFile=".\logs\stdout" | |
forwardWindowsAuthToken="false"/> | |
<rewrite> | |
<rules> | |
<rule name="HTTPS rewrite behind AWS Elastic 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment