proxy_ignore_headers Cache-Control + Set-Cookie do not work both

Maxim Dounin mdounin at mdounin.ru
Thu Sep 5 17:33:21 UTC 2013


Hello!

On Thu, Sep 05, 2013 at 09:09:06AM -0400, Falk wrote:

> Hi,
> in a reverse-proxy setup I want to ignore "Cache-Control:" and "Set-Cookie:"
> for .css and some more.
> 
> Each one works perfectly.
> 
> Pages sent with a cookie are being cached:
> location ~* \.(css|ico|js) {
>                 proxy_pass  http://Upstream-server;
>                 proxy_ignore_headers Set-Cookie; }
> 
> Pages sent with a cookie are being cached (just for reference):
> location ~* \.(css|ico|js) {
>                 proxy_pass  http://Upstream-server;
>                 proxy_ignore_headers Set-Cookie Expires; }
> 
> Pages sent with a cookie are NOT being cached:
> location ~* \.(css|ico|js) {
>                 proxy_pass  http://Upstream-server;
>                 proxy_ignore_headers Set-Cookie Cache-Control; }
> 
> nginx version: nginx/1.1.19
> Ubuntu 12.04 LTS.
> 
> What am I doing wrong?

Ignoring the Cache-Control header likely results in no cache time  
information available.  You have to set proxy_cache_valid then for 
a cache to work, see http://nginx.org/r/proxy_cache_valid.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list