nginx负载均衡后端健康检查方式

第一种是nginx的upstream自带的被动检查,这种只能通过后端的端口做检测,而不能通过url,所以当后端的端口是开的,但是页面可能出现403,503错误时nginx还是会把客户端的request请求到无法提供服务的后端 
upstream  test{
           server 192.168.110.110:80 max_fails=1 fail_timeout=10s;
           server 192.168.110.112:8080 max_fails=1 fail_timeout=10s;
    }
location / {
            root   html;
            proxy_pass http://test;
        }
第二种是通过第三方模块nginx_upstream_check_module来根据设定的url做检测
 
原文地址:https://www.cnblogs.com/allmdzz/p/11182256.html