我的 web.config (MVC 5) 中有以下重写代码,这显然导致流量管理器注册“降级”,因为它得到了重写(我怀疑是 301 状态)。我已将流量管理器设置为监控 HTTPS。我还需要做什么?
<system.webServer>
<!-- http://blog.smarx.com/posts/redirecting-to-https-in-windows-azure-two-methods -->
<!--<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{URL}" pattern="/$" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
</rule>
</rules>
</rewrite>-->
<validation validateIntegratedModeConfiguration="false" />
更新这可能适用于我的家庭控制器:
/// <summary>
/// For Azure Traffic Manager Monitoring /Home/TrafficManagerProbe
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public HttpResponseMessage TrafficManagerProbe()
{
return new HttpResponseMessage(HttpStatusCode.OK);
}