Nginx – How to alter the Last-Modified header on nginx

cachehttp-headersnginxweb-server

My server returns the following headers:

Cache-Control:no-cache
Connection:keep-alive
Date:Thu, 07 Jul 2011 10:41:57 GMT
Expires:Thu, 01 Jan 1970 00:00:01 GMT
Last-Modified:Thu, 07 Jul 2011 08:06:32 GMT
Server:nginx/0.8.46`

I want the content I'm serving not to be cached, so I'm looking for a way to return a Last-Modified header that contains the date-time when the request was originated. Something like now()…

Best Answer

"I want the content I'm serving not to be cached" : You can turn off If-Modified-Since request header checking with if_modified_since off; directive. if_modified_since doc

And about Last-Modified header: You can turn it off with add_header Last-Modified "";