./configure --prefix=/usr/local/nginx-1.24.0 --user=www --group=www --conf-path=/usr/local/nginx-1.24.0/conf/nginx.conf --http-client-body-temp-path=/usr/local/nginx-1.24.0/cache/client_temp --http-proxy-temp-path=/usr/local/nginx-1.24.0/cache/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx-1.24.0/cache/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx-1.24.0/cache/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx-1.24.0/cache/scgi_temp --add-module=/usr/local/src/nginx_upstream_check_module-1.1.1 --with-compat --with-debug --with-http_geoip_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_degradation_module --with-http_slice_module --with-http_auth_request_module --with-pcre --with-pcre-jit --with-mail --with-mail_ssl_module --with-threads --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

upstream.conf


upstream webs {
    server 172.16.1.1:80 max_fails=2 fail_timeout=10s;
    server 172.16.1.2:80 max_fails=2 fail_timeout=10s;
    check interval=3000 rise=2 fall=3 timeout=1000 type=tcp;
    #interval  检测间隔时间,单位为毫秒
    #rise      表示请求2次正常,标记此后端的状态为up
    #fall      表示请求3次失败,标记此后端的状态为down
    #type      类型为tcp
    #timeout   超时时间,单位为毫秒
    check_http_send "HEAD /api/tTag/queryTag HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx;
    #check_http_send 定义了发送给后端服务器的检查请求。
    #check_http_expect_alive 指定哪些 HTTP 状态码会被认为是“存活”的。