我在proxy_balancer.conf中设置了以下内容,服务器正在创建cookie,但服务器仍然会在每次刷新或重定向时切换。我做错了什么?
NameVirtualHost *:80
ServerName mantra.inn650
RewriteEngine On
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://mycluster>
BalancerMember http://10.6.2.2 route=1
BalancerMember http://10.6.2.3 route=2
</Proxy>
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://forumcluster/
ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ServerName blog.mantra.inn650
RewriteEngine On
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://blogcluster>
BalancerMember http://10.6.2.2 route=1
BalancerMember http://10.6.2.3 route=2
</Proxy>
ProxyPass / balancer://blogcluster/
ProxyPassReverse / balancer://forumcluster/
ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
答案 0 :(得分:0)
看起来你错过了:
ProxySet stickysession=ROUTEID
指令中的 <Proxy balancer://...>
。
来自文档:http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html