Vote count:
0
Consider the following code which is used to redirect www.myDomain.com to myDomain.com:
<rule name="rule name" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^www.mydomain.com$" />
</conditions>
<action type="Redirect" url="{CloudFront-Forwarded-Proto}://mydomain.com/{R:0}" redirectType="Permanent" />
</rule>
Although all calls to my IIS server come by way of HTTP from the CDN edge servers, it's important that the user's original protocol choice, be it https or http, be retained during the redirect.
Rather than using the HTTP_X_FORWARDED_PROTO
header to indicate the user's original protocol, the CDN uses CloudFront-Forwarded-Proto
. You can see from my code that I'm trying to reference that header when crafting the target redirected URL but somehow the user still ends up being redirected via HTTP, even if his original protocol is HTTPS.
Is there a problem with my syntax ?
asked 35 secs ago
IIS Rewrite based on Nonstandard CDN Header
Aucun commentaire:
Enregistrer un commentaire