Welcome! Log In Create A New Profile

Advanced

Cookie problem with proxy cache

Ole Laursen
November 17, 2009 12:26AM
I had a problem with the proxy cache. I have a login page that sets a cookie and
returns "Vary: cookie". For some reason, nginx seems to think the page can be
cached and thus strips the Set-Cookie header. So I can't login. :)

I've fixed the problem by adding a proxy_pass_header Set-Cookie. But I guess the
root of the problem is that nginx thinks it can cache the page in spite of the
"Vary: cookie" header. Isn't this a bug?

For the record, Varnish doesn't cache Vary: cookie pages.

I have the following cache settings, copied from an example in the English
documentation:

proxy_cache defaultzone;
proxy_cache_valid 200 302 2m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 30s;

The login page comes from a web framework (Django admin) which makes plenty use
of the Vary: cookie header.


Ole
Subject Author Posted

Cookie problem with proxy cache

Ole Laursen November 17, 2009 12:26AM

Re: Cookie problem with proxy cache

Emanuele Pucciarelli November 17, 2009 12:56PM

Re: Cookie problem with proxy cache

Jérôme Loyet November 17, 2009 01:18PM

Re: Cookie problem with proxy cache

Gabriel Ramuglia November 17, 2009 02:04PM

Re: Cookie problem with proxy cache

Ole Laursen November 18, 2009 03:48PM

Re: Cookie problem with proxy cache

Gabriel Ramuglia November 18, 2009 04:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready