
如果nginx没有安装fair模块,在使用fair负载均衡的模式的时候会报错
获取到当前nginx的版本号
获取到对应本部的nginx的源码包和fair模块文件
解压nginx源码包并编译带上fair模块文件./configure --prefix=/etc/nginx --add-module=/root/shell/nginx-upstream-fairmake不要make install,会覆盖
./configure: error: the HTTP rewrite module requires the PCRE library.
yum -y install pcre pcre-devel
./configure: error: the HTTP gzip module requires the zlib library.
yum -y install zlib zlib-devel编译完成之后再次执行步骤4
