代码之家  ›  专栏  ›  技术社区  ›  Elliot Starks

Azure流量管理器显示端点降级,但返回200

  •  3
  • Elliot Starks  · 技术社区  · 8 年前

    类似 this question

    我了解到,这通常表明监视器配置导致的响应不是200。但是,使用curl进行测试显示两个端点的响应都是200。最初,我将它设置为探测主页(也返回了200),但为了以防万一,我添加了一个专用的“探测”页面,这没有什么区别。

    以下是我的流量管理器配置(经典门户,但这不重要):

    enter image description here

    浏览器网络检查器:

    enter image description here

    以下是我的卷曲结果:

    enter image description here

    显然,如果所有端点都降级,流量管理器仍将运行,但我担心这可能会影响我们的地理冗余。

    提前感谢您的任何帮助!

    1 回复  |  直到 7 年前
        1
  •  2
  •   evilSnobu    8 年前

    这个 -L 在你 curl 调用是为了“跟踪重定向”,这会让您感到厌烦。

    Traffic Manager won't follow HTTP redirects!

    因为您的端点现在返回 301 Moved Permanently 他们正在被渲染 退化 .

    $ curl -Ii http://posguys-east.cloudapp.net/probe.html
    
    HTTP/1.1 301 Moved Permanently
    Content-Length: 147
    Content-Type: text/html; charset=utf-8
    Location: https://posguys.com/probe.html
    

    这很可能是因为您有一个HTTP→ 您的中配置了HTTPS重定向 web.config .

    解决方案很简单,使用 https:// 相反

    稍后编辑

    不是那么简单,看起来您的应用程序正在响应 301 重新定向 https://

    $ curl -kIiL https://posguys-east.cloudapp.net/probe.html
    HTTP/1.1 301 Moved Permanently
    Content-Length: 147
    Content-Type: text/html; charset=utf-8
    Location: https://posguys.com/probe.html
    Server: Microsoft-IIS/8.5
    
    HTTP/1.1 200 OK
    Cache-Control: max-age=5184000
    Content-Length: 149
    Content-Type: text/html
    

    你需要解决这个问题。为添加例外 /probe.html 不管你在写什么重写规则。测试 卷曲 但是没有 -L 这次。