在nginx的upstream中添加 ip_hash即可例如:upstream XXXX{ip_hash;server 192.168.8.8:8080;server 192.168.8.9:8080;}