nginx健康检查 upstream_check_module

nginx健康检查 upstream_check_module

Scroll Down

安装nginx的依赖包(pcre和zlib)

安装pcre

cd pcre-8.40
./configure
make
make install

安装zlib

tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install

安装nginx

上传安装包(可以使用winscp、xftp等工具)

相关安装命令集如下

#下载nginx_upstream_check_module模块
#进入nginx安装目录
[root@centos8 ~]# cd /usr/local/nginx

#下载nginx_upstream_check_module模块
[root@centos8 nginx]# wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master
 
#解压
[root@centos8 nginx]# unzip master
 
#进入nginx的源码目录
[root@centos8 ~]# cd /root/nginx-1.17.4
 
# -p0,是“当前路径” -p1,是“上一级路径”
[root@centos8 nginx-1.17.4]# patch -p0 < /usr/local/nginx/nginx_upstream_check_module-master/check_1.11.5+.patch
 
#安装配置
[root@centos8 nginx-1.17.4]# ./configure --prefix=/usr/local/nginx --add-module=/usr/local/nginx/nginx_upstream_check_module-master/
 
#开始安装
[root@centos8 nginx-1.17.4]# make && make install

#导出nginx安装哪些模块
[root@centos8 nginx-1.17.4]# nginx -V
nginx version: nginx/1.17.4
built by gcc 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC) 
built with OpenSSL 1.1.1c FIPS  28 May 2019
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-pcre --with-http_ssl_module --with-http_v2_module --with-http_realip_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_auth_request_module --with-mail --with-mail_ssl_module --with-stream_ssl_module