- 使用nginx中的第三方sticky模块实现tomcat负载均衡中的会话保持
server1:
openresty并没有粘制位的模块所以在nginx来实现
/usr/local/openresty/nginx/sbin/nginx -s stop 停止openresty
cp /usr/local/openresty/nginx/conf/nginx.conf /usr/local/lnmp/nginx/conf/nginx.conf 将openresty的配置文件复制给nginx
tar zxf nginx-sticky-module-ng.tar.gz
cd nginx-1.16.0
./configure --prefix=/usr/local/lnmp/nginx --user=nginx --group=nginx --with-threads --with-file-aio --with-http_sub_module --with-http_ssl_module --add-module=/root/nginx-sticky-module-ng 重新编译,添加sticky模块
cd objs/ ngx_modules.c 新增的模块
make && make install