Hello,

I've run up against a behavior I don't understand. I have a request header
that would be ideal to use for stickiness, however while it works if I do
"balance hdr(x-balance)", "stick on hdr(x-balance)" does not and I can't
figure out why.

Here's the configuration (somewhat abbreviated) that doesn't work (I can
see client connections switching over between the servers):

>>>
global
  chroot  /var/lib/haproxy
  daemon
  group  haproxy
  log  127.0.0.1 local0 info
  maxconn  4000
  pidfile  /var/run/haproxy.pid
  stats  socket /var/lib/haproxy/stats
  user  haproxy

defaults
  log  global
  option redispatch
  option httpclose
  option http-server-close
  retries  3
  stats  enable
  timeout connect 10s
  timeout client 10s
  timeout server 60s
  timeout check 10s

backend stage_mobile_http_backend_1
  reqrep ^([^\ ]*\ /)1.13[/]?(.*)     \1\2
  mode http
  stick on hdr(x-balance)
  stick-table type string size 100m expire 2m
  server <server1> <ip1>  check
  server <server2> <ip2>  check

listen stage_mobile_http_proxy
  bind 127.0.0.1:80
  mode http
  option tcplog
  option forwardfor
  reqadd X-Forwarded-Proto:\ http
  default_backend stage_mobile_http_backend_1
>>>

However, this backend config, does work:

>>>
backend stage_mobile_http_backend_1
  reqrep ^([^\ ]*\ /)1.13[/]?(.*)     \1\2
  mode http
  balance hdr(x-balance)
  hash-type consistent
  server <server1> <ip1>  check
  server <server2> <ip2>  check
>>>

This is on a Debian dist with Haproxy 1.4.24 (behind a Pound SSL
terminator).


Any help would be appreciated.

Thanks
/Lars J. Nilsson
Executive VP, Cubeia Ltd
+46 (0) 704 / 10 69 53

Reply via email to