Hello!
On Sat, Oct 17, 2015 at 10:40 AM, Martin Gee wrote:
> I'm attempting to add a cookie (in addition to the cookies coming from the
> browser) to send to my proxy_pass backend.
>
> when I use:
> proxy_set_header Cookie "name=123"
>
> It only sends this cookie to the backend and eliminates the cookies coming
> from the browser (which need to be passed too).
>
> I'm assuming I can do this with Lua. But, wanted to see if this can be done
> with NGINX syntax or if a good example exists.
>
Hmm, maybe something like this? (Disclaimer: untested)
more_set_input_headers "Cookie: name=123; $http_cookie";
assuming the browser does not bring a duplicate "name" cookie
(otherwise you need to be careful about how your backend deal with
duplicate cookie names).
The more_set_input_headers directive comes from the ngx_headers_more
module which is installed in OpenResty by default.
Regards,
-agentzh