Tengine中健康检查模块的一点使用经验

Tengine 中 健康检查模块(ngx_http_upstream_check_module )的使用经验

一、在需要的upstream里中配置以下信息。check_http_send、check_http_expect_alive可以不配置,默认即可。

        check interval=3000 rise=3 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;

二、检查状态结果信息

      在http的第一个Server(注意是第一个,我踩过的坑)中配置 如下信息 。

   location /status {
       check_status;
       access_log off;
    }
    location = /stub_status {
       stub_status on;
    }

   然后通过Tengine(nginx)所在的服务器IP访问(这也是我开始很迷茫的地方,不知道如何访问状态页面),

 http://121.40.140.111/status、http://121.40.140.111/status?format=json

http://121.40.140.111/stub_status

 

你可能感兴趣的:(nginx)