cookie and first load balancing

KT Walrus kevin at
Mon Jan 14 23:25:26 UTC 2013

The only reason I need haproxy in my software stack is for "cookie persistence" and "first" load balancing. I'd like to use nginx instead.

Can I do the equivalent of haproxy "cookie persistence" in nginx by testing if the request has a cookie set and then testing this cookie's value to decide which upstream to use?  Seems possible to me.

As for haproxy's "first" load balancing, is there a variable in nginx that I can test for a given server which yields the current number of active connections that nginx has with that server?  I haven't found any such variable in nginx's documentation.


More information about the nginx mailing list