1

I have two subdomains "www.example.com" and "something.example.com" but in the haproxy config they use the same backend, which has the same cookie settings. if I stay on one I can verify by the cookie which server I'm on which remains "sticky" but when I move to the other one, iIseem to then lose my stickiness and then either end up on 1 server or another

here's my current setup: ACLs:

acl acl_website    hdr(Host) www.example.com
acl acl_something     hdr(Host) something.example.com

and then here I tell haproxy to use the same backend for both

use_backend website_farm if acl_website
use_backend website_farm if acl_something

and then the backend which has the cookie info:

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

so the problem is that if I go between the two different subdomains, I lose the stickiness. is there a way to keep the stickiness between 2 subdomains in haproxy?

stambata
  • 1,668
  • 3
  • 14
  • 18

0 Answers0