服务器做重定向rewrite (.*) http://ip:xxxx/指向负载服务器,以前没有重定向是用ip_hash解决session的问题,upstream aa {ip_hash;server ip1:xxxx;server ip2:xxxx;}目前试了hash $http_x_forwarded_for;和hash $cookie_jsessionid;都没有达到负载的效果,请问需要如何配置?
1 回答

一只名叫tom的猫
TA贡献1906条经验 获得超3个赞
如果后端是Spring的话,可以考虑用redis来保存session,这样会话可以跨节点保存。
另外问下为啥要从ip_hash改成rewrite呢?
添加回答
举报
0/150
提交
取消