【发布时间】:2011-10-24 11:10:22
【问题描述】:
我们在 Azure 上部署了一个使用 https 的 Web 角色。由于这是我们希望我们的用户访问系统的唯一方式,我们希望将访问 http 版本的用户转发到 https 版本。
我们已经尝试了建议here。
也就是说,我们在 web.config 中添加了以下内容:
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
但是,这似乎不起作用。有谁知道如何做到这一点?这似乎是一个常见的要求......
【问题讨论】:
-
为了让我的静态角度站点使用 HTTPS,我使用 () 而不是 (.) 并且我有一个重定向到 index.html 的包罗万象,我删除了所有我在应用程序设置下的默认文档。
标签: azure