Nginx gzip doesn't (always) respect Accept-Encoding header?

Hi, I seem to be missing an obvious step to control nginx gzip based
(only) on the clients Accept-Encoding header?

Nginx 0.8.53. My config is:

gzip on;
gzip_min_length 900;
gzip_buffers 16 8k;

how to gzip proxied content

gzip_proxied any;
gzip_vary on;
gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;

gzip_http_version 1.1;
gzip_comp_level 6;
gzip_disable “msie6”;

Test 1
Using Firefox (use about:config) I change my Accept-Encoding header to
be blank and now Firefox show me a page of unprintable characters
(gzipped content is still sent but apparently not decoded by Firefox)

Test 2
I delete the “gzip_proxied any” directive - this time my Accept-Header
choice is respected and content is not gzipped (and readable).
Resetting my Accept-Header back to default and once again content is
gzip’ed (and readable)

So, it would appear that the directive gzip_proxied, also controls
whether nginx respects the Accept-Encoding header? This seems
unexpected (and undesirable)? My goal would be to compress all content
purely based on the Accept-Header and disregard and Via headers (if the
proxy is dim enough to request gzipped content and can’t handle it, then
it’s there problem)

Is this behaviour expected? Changed in some later release?

Thanks

Ed W

Hello!

On Tue, May 31, 2011 at 10:19:54PM +0100, Ed W wrote:

Hi, I seem to be missing an obvious step to control nginx gzip
based (only) on the clients Accept-Encoding header?

[…]

Test 1
Using Firefox (use about:config) I change my Accept-Encoding
header to be blank and now Firefox show me a page of unprintable
characters (gzipped content is still sent but apparently not
decoded by Firefox)

Are you sure content is actually “sent”? I suspect it’s extracted by
Firefox from it’s cache instead.

Maxim D.

On 31/05/2011 23:34, Maxim D. wrote:

Test 1
Using Firefox (use about:config) I change my Accept-Encoding
header to be blank and now Firefox show me a page of unprintable
characters (gzipped content is still sent but apparently not
decoded by Firefox)

Are you sure content is actually “sent”? I suspect it’s extracted by
Firefox from it’s cache instead.

Hmm, I believe it was sent because I could see the file size changing?
However, I have upgraded to nginx 1.0 and repeated the test and I see no
problem now.

At worst I guess it’s something which is fixed, will also concede user
error though! Seems fine in any case

Thanks so much for nginx

Ed W