Nginx添加nginx_upstream_check_module主动健康检查模块步骤

1. 进入nginx第三方模块存放目录,没有就创建

cd /usr/local/nginx/module
 #下载nginx_upstream_check_module
 wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master
 #解压
 unzip nginx_upstream_check_module-master.zip

2. 加载nginx_upstream_check_module

#安装patch
yum install patch -y
# 加载小于或等于nginx版本check,如果命令报错
patch -p1 < /opt/nginx_upstream_check_module/check_1.9.2+.patch

cd nginx-1.9.9
./configure --prefix=/usr/local/nginx-1.9.9 \
--sbin-path=/usr/local/nginx/sbin/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--pid-path=/usr/local/nginx/run/nginx.pid \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-log-path=/usr/local/nginx/logs/access.log \
--with-pcre \
--user=nginx \
--group=nginx \
--with-stream \
--with-threads \
--with-file-aio \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--add-module=/usr/local/nginx/module/nginx_upstream_check_module-master

make

make upgrade

3. 查看是否添加成功

./sbin/nginx -V

Nginx添加nginx_upstream_check_module主动健康检查模块步骤_第1张图片

你可能感兴趣的:(nginx,运维)