Does Nginx support cookie which acts as a load balance?

Manlio Perillo manlio_perillo at
Thu Jan 17 14:47:42 MSK 2008

Michael Rzechonek ha scritto:
> Evan Miller wrote:
>> I did something similar a while ago. The attached patch adds variables
>> for accessing cookies ($http_cookie_foo => "foo" cookie). You can use it
>> in conjunction with the Upstream Hash module:
> I think you forgot to add the attachment ;-)
> I tried using mod_userid and hash $uid_got, but unfortunately to no 
> avail :-(
> Your patch would be *very* useful to me.

Give a look at:


The current version requires a small patch to nginx.

unlike the Evan's patch, I have written a custom parser for the cookies.

I was not aware of the ngx_http_parse_multi_header_lines function, but 
cookies format is a mess so a custom parser may be a better solution.

> regards
> --
> Khorne

Manlio Perillo

More information about the nginx mailing list