2

I would like to know how to add file md5 checksum to a nginx HTTP response header. The details is described below:

I have a nginx server to serve some static files, these files are generated daily by other program, the old file will be overwritten when generating the new one.

Sometimes the file content changed, sometimes not. But the modified time always changed.

And I have an android app to download these files everyday, it should download only changed files.

I cannot use etag because it was generated from file length and timestamp, and timestamp always changed.

Thank you.

youchenlee
  • 41
  • 2
  • 5
  • [This](http://stackoverflow.com/questions/24971724/nginx-pass-upstream-headers-to-the-remote-request) post and [this](https://stackoverflow.com/questions/24507157/adding-custom-http-headers-to-nginx-x-accel-redirect) post might help. – Keenan Lawrence Jul 29 '16 at 12:33
  • Thank you @KeenanLawrence . yes Content-MD5 is the correct keyword. Problem solved! There is a gist that use nginx perl module to generate Content-MD5 header: https://gist.github.com/sivel/1870822 – youchenlee Jul 29 '16 at 13:40
  • Nice! Thanks for the info. It's useful to know these things... – Keenan Lawrence Jul 29 '16 at 14:53

0 Answers0