Keep session-affinity in custom origins haproxy not using cookies

Hi, I have 2 HAProxy servers configured using “peers” the ones serve traffic from a load balancer provided by Cloudflare, but wondering how could I have “session-affinity” , the flow is like this:

example.com ---> CNAME my-lb.example.com ---> Cloudflare Load balancer my-lb.example.com
                                             |- origin 1 (haproxy 1)
                                             |- origin 2 (haproxy 2)

I am trying this:

backend test 
    stick-table type ip size 1m expire 30m peers/ha-peers
    stick on src
    dynamic-cookie-key test
    cookie __sa insert indirect dynamic nocache maxidle 30m maxlife 30m
    default-server check init-addr none resolvers consul resolve-opts prevent-dup-ip
    server-template test- 2 _test._tcp.service.consul ssl verify none

But wondering when not using cookies “Client IP fallback”, how to still guarantee session-affinity, in the origins used from the load balancer, in this case (haproxy)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.