nginx 原生的负载均衡只是后端服务进行逐个尝试,而不是主动对后端服务进行探测,下面对最新稳定版的nginx 1.26 打上 负载均衡主动探测功能。
见之前文章 https://wenda.zuncuang.com/article/25
我是在ubuntu24.04上安装的
nginx已经从1.23上支持了openssl-3.0.X 我当前的 ubuntu 24.04 上的openssl 版本是:
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
apt install -y libjemalloc-dev libpcre3-dev libghc-zlib-dev lrzsz libgflags2.2 debsums libmecab2 libssl-dev libgd-dev
git clone https://github.com/nginx/nginx.git git clone https://github.com/alexzzh/ngx_health_detect_module.git
#如果没有合适补丁,那说明此补丁暂时不支持当前的nginx版本
如果没有错误,说明补丁正常打完,可以通过 git status 查看。如果不合适,通过git reset --hard 恢复即可
git checkout stable-1.26
./auto/configure --user=www --group=www --prefix=/usr/local/nginx_new --with-stream --with-pcre --add-module=../ngx_health_detect_module --with-http_v2_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-http_v3_module
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!