Other headers disappear after adding Set-Cookie header

Unimatrix02 nginx-forum at nginx.us
Mon Aug 16 15:57:51 MSD 2010


I have the following problem. 

In a configuration with several locations, I am using 
add_header Set-Cookie "name=value; domain=xyz.com; path=/";
and some other headers, like
add_header X-Info "Some information"

When the Set-Cookie header is added, all additional headers suddenly
disappear. When the Set-Cookie add_header call is disabled, the
additional headers appear as normal.

First I thought it might be a bug, but this behavior doesn't occur when
I put this combination of headers in another location in another
(simpler) server block. I also upgraded from 0.7.67 to 0.8.49 to see if
that would make a difference, but it still happens.

Apparently there is something that drops the additional headers, but I
have no idea what. I have disabled all other locations, disabled all
other things (like expires), but without any effect.

The server block in which this happens is build up as follows:
- Capture of a variable from the URL;
- Rewrite of certain URLs to a static HTML page;
- Location to serve the static HTML pages, which includes the add_header
call for Set-Cookie, to pass on the value from the captured variable in
a cookie;
- Location to serve other static content (css, images, etc);
- Location to proxy to apache. 

I hope someone knows why this happens, and if it should be considered a
bug or not.



Posted at Nginx Forum: http://forum.nginx.org/read.php?2,120295,120295#msg-120295

More information about the nginx mailing list