Possible gzip_vary bug? (v1.5.1)

Maxim Dounin mdounin at mdounin.ru
Wed Jun 19 13:48:28 UTC 2013


On Wed, Jun 19, 2013 at 08:52:14AM -0400, Fleshgrinder wrote:

> I'm running the latest development version of nginx and gzipping is working.
> But no Vary Accept-Encoding header is added to any gzip response. The
> gzip_http_version isn't affecting the behavior, no matter if I set it to 1.0
> or 1.1 no header is sent. Even if I add the header myself via the add_header
> directive, nothing.
> If I use PHP to add the header it's there. Any ideas what the problem could
> be?
> My configure options:
> https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh
> My configuration: https://github.com/MovLib/www/tree/master/conf/nginx
> Specifically the gzip configuration:
> https://github.com/MovLib/www/blob/master/conf/nginx/conf/gzip.conf

Works fine here:

: GET / HTTP/1.1
: Host: foo
: Accept-Encoding: gzip
: HTTP/1.1 200 OK
: Server: nginx/1.5.2
: Date: Wed, 19 Jun 2013 13:23:39 GMT
: Content-Type: text/html
: Last-Modified: Mon, 27 Apr 2009 14:40:49 GMT
: Transfer-Encoding: chunked
: Connection: keep-alive
: Vary: Accept-Encoding
: Content-Encoding: gzip

Best guess that in your case gzipping happens not in nginx (in 
php?), and add_header doesn't work for you due to other add_header 
directives used on more specific levels.

Alternatively, you might be testing with spdy, where gzip_vary 
does nothing as all clients are required to support gzip.

If you still think there is a bug, you may want to provide a 
simple configuration to reproduce the problem.

Maxim Dounin

More information about the nginx mailing list