我有两个子域名“www.example.com”和“something.example.com”,但在haproxyconfiguration他们使用相同的后端,具有相同的cookie设置。 如果我留在一个,我可以通过cookie来validation我在哪个服务器上仍然是“粘性”,但是当我移动到另一个时,iIseem然后失去我的粘性,然后最终在1台服务器或另一台
这里是我目前的设置:ACL:
acl acl_website hdr(Host) www.example.com acl acl_something hdr(Host) something.example.com
然后在这里我告诉haproxy为两个使用相同的后端
use_backend website_farm if acl_website use_backend website_farm if acl_something
然后是具有cookie信息的后端:
backend website_farm balance roundrobin cookie qa-aspc insert indirect option httpchk HEAD /heartbeat.php HTTP/1.0 http-check disable-on-404 option redispatch server web01 web01.example.com:80 cookie 01 check fall 2 inter 2000 fastinter 1000 server web02 web02.example.com:80 cookie 02 check fall 2 inter 2000 fastinter 1000
所以问题是如果我在两个不同的子域之间,我失去了粘性。 有没有办法保持haproxy中2个子域之间的粘性?