Browsers cache 410 Gone responses indefinitely by default. An accidental 410 can kill the URL forever. The URL might be also resurrected later for other reasons. I would like to set expires
for 410s to force browser refresh time to time. Is there a way to do it with nginx?
server {
# ...
error_page 410 /errors/410.html;
location /errors/ {
internal;
expires 1h;
}
location = /some/file {
expires 1h;
return 410;
}
}
The above config results in responses without any cache control directives.