Is it possible to use nginx to add Domain= to a Set-Cookie (from a reverse proxied / back end server) when the Set-Cookie does not already have a Domain? I am aware of proxy_cookie_domain, but I can't figure out how to use it to add the Domain if it does not already exist on the Set-Cookie header from the back end.
I tried
proxy_cookie_domain ~^$ a.b.com;
but that did not work.
It is possible by dirty hack. Assuming that path is set inside your cookie You can:
proxy_cookie_path ~^(.+)$ "$1; domain=yourdomain";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With