Ways to control the gzip_vary directive from nginx 0.6.34 and above?

Zev Blut zblut at cerego.co.jp
Tue Sep 15 08:07:50 MSD 2009


Nginx 0.6.34 and above have changed the gzip_vary directive to add
the "Vary: Accept-Encoding" header to uncompressed responses as well as
compressed responses.

The change is specifically:

Changes with nginx 0.6.34                                        27 Nov 2008

    *) Change: now the "gzip_vary" directive turned on issues a
       "Vary: Accept-Encoding" header line for uncompressed responses too.

Unfortunately for me, this change prevents us from using our CDN.
Our CDN will not cache requests for non gzipped content that has the
Vary header.  Thus, this defeats the purpose of our CDN for a large part
of our image and audio content.

For the time being, this means I have to remove the changes to the
nginx_http_gzip_static_module.c to prevent this header from showing up.

Short of hacking nginx_http_gzip_static_module.c, is there a way to prevent
this Vary header from showing up with non-gzipped content? If not, would it
be possible to make this directive configurable?

Also may I ask why this change was made?  Is there something I am
missing relating to the HTTP spec for this?

Thank you for you time,
Zev Blut

More information about the nginx mailing list