这篇博文记录如何配置Azrue WebApp只允许https访问,非https的请求一律重定向到https。
具体步骤是在web.config里加一个urlrewrite信息,如下所示,需要加在rewrite/rules节点下
<rule name=”Force HTTPS” enabled=”true”>
<match url=”(.*)” ignoreCase=”false” />
<conditions>
<add input=”{HTTPS}” pattern=”off” />
<add input=”{WARMUP_REQUEST}” pattern=”1″ negate=”true” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” appendQueryString=”true” redirectType=”Permanent” />
</rule>
Leave a Reply
You must be logged in to post a comment.