proxy_ignore_headers doesn't seem to work

Maxim Dounin mdounin at mdounin.ru
Wed Dec 14 17:09:54 UTC 2011


Hello!

On Wed, Dec 14, 2011 at 11:34:15AM -0500, piotr wrote:

> Hello,
> 
> I've problem similar as in this thread:
> http://mailman.nginx.org/pipermail/nginx/2010-May/020349.html 
> 
> nginx is ignoring my proxy_cache_valid value, using instead expire time
> specified by upstream server.  
> 
>   proxy_ignore_headers X-Accel-Expires Expires Cache-Control
> Set-Cookie;
>   proxy_cache_valid 200 302 30h;
>   proxy_cache_valid any 1h;
> 
> headers from file stored on cache:
> *****
> KEY: httpXYZ.com/tiles/1.0.0/osm/15/5240/12662.jpg
> HTTP/1.0 200 OK
> Expires: Wed, 14 Dec 2011 16:33:27 GMT
> Last-Modified: Tue, 13 Dec 2011 06:16:41 GMT
> Cache-Control: max-age=600
> Content-Type: image/jpeg
> Content-Length: 27946
> Server: Mapnik2/0.8.0
> Date: Wed, 14 Dec 2011 16:23:27 GMT
> Connection: close
> *****
> 
> from logs:
> *****
> 14/Dec/2011:10:02:11 -0600 HIT Cache-Control:max-age=600 Expires:Wed, 14
> Dec 2011 16:09:55 GMT upstream_server:- upstream_status:- (...)
> 14/Dec/2011:10:22:55 -0600 MISS Cache-Control:max-age=600 Expires:Wed,
> 14 Dec 2011 16:32:55 GMT upstream_server(...)
> *****
> 
> I've tried to add also Date and Last-Modified to proxy_ignore_headers,
> adding same headers to proxy_hide_header, but without any luck.
> 
> 
> nginx/0.8.54 from source on RHEL5.7, and nginx/1.0.10 from official deb
> package on Ubuntu10.04. 
> 
> Does anybody have any idea what could be wrong?

Try "nginx -t".  If it doesn't help, please post the full config 
you're testing with.

Maxim Dounin



More information about the nginx mailing list