HAProxy community

Load balancing for frontend


Hello all,

I use HAProxy for load balancing my HTTP requests. I have 3 front-end servers, let’s say s1, s2, and s3.I would like to know if there is any way to customize the selection of server based on connection session to my application. For example, user1 connecting to http://myapp.com and proxy links user to s1 and all his future requests will be handled only by s1. Then user2 connects to http://myapp.com and his session will be handled only by s2… I would like to know whether its possible to use such kind of routing. Because currently, I see that user’s session is switched between all frontend servers, which is not acceptable for us.


Yes, you have a number of possibilities to do this. Via cookies, via sessions stickiness, via source-IP stickiness.

Read the following blog post to get a good idea of what’s possible: