【问题标题】:Azure Traffic Manager logs degraded due to https rewrite ruleAzure 流量管理器日志因 https 重写规则而降级
【发布时间】:2016-01-22 12:48:58
【问题描述】:

我的 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);
    }

【问题讨论】:

    标签: azure azure-web-app-service azure-traffic-manager


    【解决方案1】:

    你的怀疑是正确的。 Azure 流量管理器运行状况探测必须接收 HTTP“200”才能将终结点视为在线。任何其他 HTTP 状态(包括 201、202 等)都被视为已降级。不遵循重定向(301、302 等)。

    This article 有更多关于如何解决降级端点状态的信息。

    【讨论】:

      【解决方案2】:

      以下适用于上述需要 Https 的情况。只需在 TrafficManager 配置页面底部添加 /Home/TrafficManagerProbe 作为监控链接。我现在得到的是“可用”而不是“降级”。

      /// <summary>
      /// For Azure Traffic Manager Monitoring /Home/TrafficManagerProbe
      /// </summary>
      /// <returns></returns>
      [HttpGet]
      [AllowAnonymous]
      public HttpResponseMessage TrafficManagerProbe()
      {
          return new HttpResponseMessage(HttpStatusCode.OK);
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-29
        • 1970-01-01
        • 2019-08-13
        相关资源
        最近更新 更多