nginx - missing etag when gzip is used

2019-02-12 17:49发布

问题:

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

回答1:

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.