nginx upstream 动态加载, 借助于服务注册中心…. 改天完善文档….

下载openresty

https://openresty.org/download/openresty-1.11.2.4.tar.gz

clone check补丁

git clone https://github.com/xiaokai-wang/nginx_upstream_check_module.git

下载openssl

wget https://www.openssl.org/source/openssl-1.0.2e.tar.gz

打补丁

patch -p0 < /root/nginx_upstream_check_module/check_1.11.1+.patch
cd /root/openresty-1.11.2.4/bundle/nginx-1.11.2

/root/openresty-1.11.2.4/bundle/nginx-1.11.2/src/http/modules/ngx_http_upstream_hash_module.c
/root/openresty-1.11.2.4/bundle/nginx-1.11.2/src/http/modules/ngx_http_upstream_ip_hash_module.c
/root/openresty-1.11.2.4/bundle/nginx-1.11.2/src/http/modules/ngx_http_upstream_least_conn_module.c
/root/openresty-1.11.2.4/bundle/nginx-1.11.2/src/http/ngx_http_upstream_round_robin.c
/root/openresty-1.11.2.4/bundle/nginx-1.11.2/src/http/ngx_http_upstream_round_robin.h

编译

./configure --prefix=/usr/local/openresty --with-openssl=/root/openssl-1.0.2e --with-http_v2_module --add-module=/root/nginx_upstream_check_module

gmake && gmake install