Welcome! Log In Create A New Profile

Advanced

Re: nginx removes strong etags on gzip compression

Francis Daly
January 02, 2020 06:32AM
On Wed, Jan 01, 2020 at 07:19:48AM -0500, ohbarye wrote:

Hi there,

> Hi, I'm using nginx as a reverse proxy and found a behavior that I wouldn't
> expect.

> So my question is: Is it expected behavior that nginx removes strong etags
> on gzip compression?

No, but: the thing that your upstream sends is not a thing that nginx
recognizes as a strong etag.

The HTTP/1.1 RFC (https://tools.ietf.org/html/rfc7232#section-2.3)
says that the etag header must be of the form

ETag: "abc"

or

ETag: W/"abc"

while your example sends something of the form

ETag: abc

and current nginx recognizes a weak etag when the first two characters
are W/, and a strong etag when the first character is ".

(Arguably: nginx could become more strict, and insist on W/" at the
start and " at the end of a weak etag; and insist on " at the start and
end of a strong etag; but I suspect that that is unnecessary.)

The best fix in your case is probably to change your upstream to send
valid headers.

If that is not doable, then possibly you could patch your nginx to accept
this invalid header; or possibly you could try some other config-based
manipulation to make things work the way that you want. I suspect that
either of those is likely to be more work in the long run than fixing
the upstream.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx removes strong etags on gzip compression

ohbarye January 01, 2020 07:19AM

Re: nginx removes strong etags on gzip compression

Francis Daly January 02, 2020 06:32AM

Re: nginx removes strong etags on gzip compression

ohbarye January 02, 2020 12:04PM

Re: nginx removes strong etags on gzip compression

J.R. January 02, 2020 09:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 95
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready