Hello All,
I have a question I've been trying to research but have not been having
luck. When using Openresty as a load balancer what's the proper way of
modifying client cookies to pass to a proxy backend? I need to modify a
client cookie value and pass all the cookies including the newly modified
value to the proxy backend. I also want to verify the backend server is
sending me back the cookies correctly (yes the backend will send the
cookies back). As far as I understand ngx.header.set_cookies is used to
send cookies back to the client (Response) but I need to send the cookies
modified to the proxy after the request but before response phases. The
item I'm confused on is if there is a lua call i can make to set the
proxy_set_header Cookie and/or what is the correct format for cookies.
Again as far as I believe it's a string where of key=value delimited by
semicolon? Thanks in advance for any help on this as it's been a lot of
testing/research.
I have seen this article
http://nginx.2469901.n2.nabble.com/Rewriting-the-domain-part-of-Set-Cookie-in-a-proxy-pass-td6453554.html
but the header phase is too late (this is on its way back to the client in
response phase)
Ex.
Client -> Openresty/NGINX -> Backend Web server