Expires header for cache

discCIT nginx-forum at nginx.us
Wed Jun 2 00:31:16 MSD 2010


I am trying to get the expires header to work on the cache module.  I am limiting what content can be accessed and then would like to cache that content.  It is working to only server the specified content but it is not serving the expires header.  The backend server is not set to send and expires header and with the code below I get a an expiration not specified result.   Here is that portion of the  conf file - 

location ~* (\.jpg|\.png|\.gif|\.css|ThumbNail\.ashx|heartbeat\.htm)$ {

		valid_referers 
			none			
			blocked
			mysite.com 
			www.mysite.com
			1.mysite.com
			2.mysite.com
			3.mysite.com
			4.mysite.com;
		
		if ($invalid_referer) {
			return 444;
		}
	
			proxy_pass	http://mysite_com;		
			proxy_cache_valid 200 301 302 1480m;
                        expires	5d;
			proxy_cache dci;
			proxy_cache_use_stale   error timeout invalid_header updating;
			
    }

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




More information about the nginx mailing list