Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have configures Nginx as reverse proxy/caching server to my apache webserver.

In the nginx config file I have setting of expires 30D at the server level. My apache config file has no expires directive , i mean no directive in the file. When I inspect my server response headers wchih seem to come from Nginx, I see the following for my request:

**HTTP/200 responses are cacheable by default, unless Expires, Pragma, or Cache-Control headers are present and forbid caching. HTTP/1.0 Expires Header is present: Thu, 19 Nov 1981 08:52:00 GMT Legacy Pragma Header is present: no-cache

Can someone please suggest what is wrong , i want to set the expires to 1 month from now but it shows Thu, 19 Nov 1981 08:52:00 GMT.

Where should i start?

share|improve this question

If you are using Apache behind Nginx, then I assume you have a dynamic site. So, I guess serves dynamic content. By default, Nginx sets expires only for static files. So, please do the same test for a static file such as and you might notice the difference now.

share|improve this answer
I placed the following directive in nginx.confI checked the Expires tag for static content. – Andy Feb 5 '12 at 2:18
i placed the following config in nginx.conf location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 60d; } – Andy Feb 5 '12 at 2:19
and restarted the server. still it shows me the Thu, 19 Nov 1981 08:52:00 GMT for the expires value. please help. – Andy Feb 5 '12 at 2:20
You may want to add the following just after/before expires directive that sets the max-age to 10hours... add_header Cache-Control "max-age=86400, public, must-revalidate" – Pothi Feb 5 '12 at 4:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.