Altering HTTP Headers

Ian Shafer ian at 1321.org
Fri Aug 14 03:02:18 MSD 2009


Hello All,

I've migrated from Apache 2 to nginx. Everything is great, except I cannot
figure out how to alter a n HTTP header. Here's what's happening. I'm using
nginx as a reverse proxy. The upstream server sets a cookie using the
Set-Cookie HTTP header. I want to append something to the end of that header
before it gets to the client.

So, upstream server sends

Set-Cookie: Name=Value

I want it to look like this

Set-Cookie: Name=ValueAppendedContent

How can I do this in nginx? In Apache, here's what I did:

Header edit Set-Cookie $ 'AppendedContent'

Maybe I should mention that I'm doing this because I want to specify the
cookie domain. (I would do this in my upstream server, but it is
difficult/not possible.)

Thanks for any tips!

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090813/567f4dc2/attachment.html>


More information about the nginx mailing list