L
L
listentome2015-08-05 11:13:19
Nginx
listentome, 2015-08-05 11:13:19

How to add Last-Modified header in nginx?

Good afternoon, there is a folder accessible by URL ( index on ) with mp3 tracks, from which person-N will rob them into his playlist, once a day person-P will add them there. How can I add a last-modified header to GET responses to this URL so that the N-person checks the relevance of the information on it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2015-08-05
@POS_troi

Check returns does not return:

< HTTP/1.1 200 OK
< Server: nginx/1.4.6 (Ubuntu)
< Date: Wed, 05 Aug 2015 10:50:37 GMT
< Content-Type: text/html
< Content-Length: 33118
< Last-Modified: Mon, 13 Jul 2015 12:23:35 GMT
< Connection: keep-alive
< ETag: "55a3adc7-815e"
< Expires: Thu, 06 Aug 2015 10:50:37 GMT
< Cache-Control: max-age=86400
< Strict-Transport-Security: max-age=31536000; includeSubdomains;
< Accept-Ranges: bytes

< HTTP/1.1 304 Not Modified
< Server: nginx/1.4.6 (Ubuntu)
< Date: Wed, 05 Aug 2015 10:52:03 GMT
< Last-Modified: Mon, 13 Jul 2015 12:23:35 GMT
< Connection: keep-alive
< ETag: "55a3adc7-815e"
< Expires: Thu, 06 Aug 2015 10:52:03 GMT
< Cache-Control: max-age=86400
< Strict-Transport-Security: max-age=31536000; includeSubdomains;

To be honest, a strange method for detecting updates, as for me, a file with the listed hash amounts will be more reliable and simpler.

V
Vlad Zhivotnev, 2015-08-05
@inkvizitor68sl

For static files that you give from disk, nginx itself gives Last-Modified and ETag by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question