Skip to content

Instantly share code, notes, and snippets.

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 villian/821e4f4179f041eb6fbd1f81d9d82f97 to your computer and use it in GitHub Desktop.
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:
<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