编译添加fair模块
fair模式会按后端服务器的响应时间来分配请求,响应时间短的优先分配。
1、下载nginx-upstream-fair模块
https://github.com/gnosek/nginx-upstream-fair
2、将下载资源上传并进行重命名
unzip nginx-upstream-fair-master.zip
mv nginx-upstream-fair-master fair
3、查看nginx信息并进行重新编译
nginx -V
红框里的因为nginx以前就添加过模块不用在意,没有的添加上就可以
# 重新编译并添加fair模块
./configure --user=root --group=root \
--prefix=/home/utry/utry_workspace/nginx \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_ssl_module \
--with-stream \
--add-module=/home/install/nginx/nginx-upstream-fair-master
# 编译

本文介绍如何在Nginx中安装配置fair模块和check模块。fair模块按响应时间分配请求,check模块用于健康检查,确保服务稳定。文中详细记录了安装步骤及常见问题解决方案。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



