Code Monkey home page Code Monkey logo

Comments (3)

yaoweibin avatar yaoweibin commented on May 22, 2024

你好,这个问题不仅仅是健康检查的问题,就算健康检查能更新,upstream块里面的server地址也不会更新。

后端服务器动态更新模块我们正在开发 (https://github.com/yzprofile/ngx_http_dyups_module ),但是可能跟你的想法有点不一样,我们的做法是动态更新服务器,而不需要reload。

你们的需求或许可以通过正向代理的方法来解决,比如类似这样:

location / {
     resolver 8.8.8.8;
     proxy_pass http://$host;
}

它可以定期查询后端的DNS服务器,动态更新服务器的IP。

from tengine.

guoguo92 avatar guoguo92 commented on May 22, 2024

不知道现在还有没有人回答我这个问题~.~ tengine-2.2.0 upstream http携带主机头check,当后端对应两个站点时,其中一个down掉,另外一个正常,健康检查也是正常的。。配置如下:
check interval=1000 rise=2 fall=1 timeout=1000 type=http;
check_http_expect_alive http_2xx http_3xx http_4xx http_5xx;
check_keepalive_requests 100;
check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\nHost: 123.123.info\r\n\r\n";
其中check_http_expect_alive如果不加http_4xx 和http_5xx,还会报502错误

from tengine.

yaoweibin avatar yaoweibin commented on May 22, 2024

监控检查时源站是返回了4xx或者5xx了吧?

from tengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.