Welcome! Log In Create A New Profile

Advanced

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

Ed W
May 31, 2011 05:22PM
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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

Ed W May 31, 2011 05:22PM

Re: nginx gzip doesn't (always) respect Accept-Encoding header?

Maxim Dounin May 31, 2011 06:36PM

Re: nginx gzip doesn't (always) respect Accept-Encoding header?

Ed W June 01, 2011 06:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready