13

If I setup nginx to use gzip, it removes any etag header.

The reasoning behind this is that the same resource cannot be byte-for-byte identical given that gzip has various compression levels.

But nginx also removes a weak etag, which just means that the resources are semantically equivalent. This seems like incorrect behavior by nginx.

Am I missing something? If not, is there a way to fix this?

wiki

arahant
  • 2,203
  • 7
  • 38
  • 62
  • What the config and what version of nginx do you use? – Alexey Ten Jun 30 '15 at 07:43
  • nginx 1.6. In config I have gzip=on and etag=on. If I change to gzip=off, then etag works. – arahant Jun 30 '15 at 07:47
  • 4
    You should upgrade to [nginx 1.7.3](https://allmychanges.com/p/soft/nginx/#1.7.3) or higher. `Feature: weak entity tags are now preserved on response modifications, and strong ones are changed to weak.` – Alexey Ten Jun 30 '15 at 07:48
  • Oh wow, thanks. I am not sure why I assumed that 1.6 is the latest. why not post your comment as an answer? – arahant Jun 30 '15 at 09:03

1 Answers1

12

You should upgrade to nginx 1.7.3 or higher.

Feature: weak entity tags are now preserved on response modifications, and strong ones are changed to weak.

Alexey Ten
  • 13,794
  • 6
  • 44
  • 54