proxy_pass to different upstreams based on a cookie in the http request header
francis at daoine.org
Wed Jun 11 17:10:08 UTC 2014
On Wed, Jun 11, 2014 at 12:46:41AM -0700, Kunal Pariani wrote:
> Am wondering if there is a way to proxy (i.e proxy_pass inside location
> directive) to different set of upstreams based on whether a particular
> cookie is present or not in a http request header.
You can use a map (http://nginx.org/r/map)
to set a variable based on a cookie
and you can use a variable in your proxy_pass directive
So it looks like it should Just Work.
Francis Daly francis at daoine.org
More information about the nginx