Last active
April 29, 2020 12:53
-
-
Save villian/821e4f4179f041eb6fbd1f81d9d82f97 to your computer and use it in GitHub Desktop.
CloudFlare Flexible SSL Redirect Loop on ASP.Net Umbraco nopCommerce website. Cloudflare appends the CF-Visitor HTTP header as explained: <pre>CF-Visitor: {"scheme":"https"}</pre> For this reason, the respective web.config <rewrite> snippet which worked for us is the following:
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> | |
<rules> | |
<rule name="Redirect to https" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTP_CF_VISITOR}" pattern="(.*)https(.*)" ignoreCase="true" negate="true" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" redirectType="Permanent" /> | |
</rule> | |
</rules> | |
</rewrite> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment