How do I alter the Last-Modified header on nginx?

"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 "";


You may want to make it look like a file is always modified:

add_header Last-Modified $date_gmt;
if_modified_since off;
etag off;

As for the last line, if you really want to hide a true last-modified date, then you must hide the ETag header too since it leaks timestamps.