Other headers disappear after adding Set-Cookie header

Maxim Dounin mdounin at mdounin.ru
Mon Aug 16 16:18:34 MSD 2010


On Mon, Aug 16, 2010 at 07:57:51AM -0400, Unimatrix02 wrote:

> Hi,
> 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.

Please show:

1. Exact config which exposes the problem.

2. nginx -V output

3. Debug log.

See http://wiki.nginx.org/NginxDebugging for details.

Maxim Dounin

More information about the nginx mailing list