1.升级nginx 版本至1.9.0以上
升级流程参考 nginx平滑升级
2.配置编译的时候需要加上
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-stream
make
cp ./objs/nginx /usr/local/nginx/sbin/
make upgrade
3.修改配置文件
stream
{
upstream cloudsocket
{
hash $remote_addr consistent;
server .x.xx.: weight= max_fails= fail_timeout=30s;
}
server
{
listen ;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass cloudsocket;
}
}
stream 与 http 是一个层级的,放在配置文件最后
4.重启服务
[root@t-scrmap1-v-szzb nginx]# ./sbin/nginx -s reload