ip_hash的配置方法

https://www.cnblogs.com/chenlifan/p/13591837.html

接上

[root@lb01 ~]# vim /etc/nginx/conf.d/node_proxy.conf 
upstream web {
    server 172.16.1.7:80 ;
    server 172.16.1.8:80 ;
    ip_hash;
}

server {
    listen 80;
    server_name linux.node.com;

    location / {
        proxy_pass http://web;
        include proxy_params;
    }
}

[root@lb01 ~]# systemctl restart nginx

 

原文地址:https://www.cnblogs.com/chenlifan/p/13592079.html