nginx添加nginx_upstream_check_module

# 模块地址:https://github.com/yaoweibin/nginx_upstream_check_module

重新解压 nginx包

patch -p1 < ../nginx_upstream_check_module-master/check_1.16.1+.patch

#重新编译
./configure --prefix=/app/confengine/nginx \
--with-http_stub_status_module \
--with-pcre=/app/confengine/software/pcre-8.13 \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_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_auth_request_module \
--with-threads \
--with-http_slice_module \
--with-file-aio \
--with-http_v2_module \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream \
--with-ld-opt=-Wl,-rpath,/usr/local/lib \
--add-module=/app/confengine/software/ngx_cache_purge-2.3 \
--add-module=/app/confengine/software/lua-nginx-module-0.10.15rc1 \
--add-module=/app/confengine/software/ngx_devel_kit-0.3.0 \
--with-zlib=/app/confengine/software/zlib-1.2.11 \
--with-openssl=/app/confengine/software/openssl-1.0.2t \
--add-module=/app/confengine/software/nginx_upstream_check_module-master

# make 不要 make install

# 查看是否编译出模块
objs/nginx -V

# 然后把  objs下的 nginx 拷贝到 /app/confengine/nginx/sbin

setcap cap_net_bind_service=+ep /app/confengine/nginx/sbin/nginx

chown #注意权限

#在traefik下添加配置
check interval=5000 rise=1 fall=3 timeout=4000;

server {
            listen 80;

            location / {
                proxy_pass http://cluster;
            }

            location /status {
                check_status;
                access_log   off;
           }
}

#配置好后 一定要重启下nginx  不要 reload
posted @ 2020-10-16 17:48  博客萨斯州  阅读(1276)  评论(1编辑  收藏  举报