I am currently using HAProxy in front of a group if IIS .NET application servers. An unforeseen problem has arisen: I am using cookies for load-balancing, this obviously doesn't work for browser that refuses the use of cookies (given the recent changes in cookie laws in the UK, lets not go into that here tough).
This is my current HAProxy config:
listen backend-servers 127.0.0.1:80
cookie bs insert
balance roundrobin
option persist
option redispatch
server appserver1 192.168.0.1:80 cookie bs1
server appserver2 192.168.0.2:80 cookie bs2
I don't want to re-design the application so I would like to find a way around this in HAProxy.
There are a couple of options like balancing using source IP, or a string in the URL, but can you use more than one method in HAProxy? Can you configure a fall back method or alternative method like this?
Thank you
Best Answer
If the cookie doesn't get saved, then haproxy dispatches based on your
balance
keyword only, which isroundrobin
.