# Possible gzip\_vary bug? (v1.5.1)

**URL:** <https://www.ruby-forum.com/t/possible-gzip-vary-bug-v1-5-1/245574>\
**Category:** NGINX\
**Created:** [June 19, 2013, 2:52pm UTC](https://www.ruby-forum.com/t/possible-gzip-vary-bug-v1-5-1/245574 "2013-06-19T14:52:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [June 19, 2013, 2:52pm UTC](https://www.ruby-forum.com/t/possible-gzip-vary-bug-v1-5-1/245574/1 "2013-06-19T14:52:48Z")

</div>

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](https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh)  
My configuration: [https://github.com/MovLib/www/tree/master/conf/nginx](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](https://github.com/MovLib/www/blob/master/conf/nginx/conf/gzip.conf)

Posted at Nginx Forum:

> **[Possible gzip\_vary bug? (v1.5.1)](https://forum.nginx.org/read.php?2,240214,240214#msg-240214)**
>
> 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....

---

<div class="post-metadata">

**Author:** ![Fleshgrinder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e480ec/32.png) [@Fleshgrinder](https://www.ruby-forum.com/u/Fleshgrinder)\
**Post date:** [June 19, 2013, 3:48pm UTC](https://www.ruby-forum.com/t/possible-gzip-vary-bug-v1-5-1/245574/2 "2013-06-19T15:48:53Z")

</div>

Hello!

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

> [https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh](https://github.com/MovLib/www/blob/master/conf/install-scripts/nginx.sh)  
> My configuration: [www/conf/nginx at master · MovLib/www · GitHub](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](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 D.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![Fleshgrinder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e480ec/32.png) [@Fleshgrinder](https://www.ruby-forum.com/u/Fleshgrinder)\
**Post date:** [June 19, 2013, 7:53pm UTC](https://www.ruby-forum.com/t/possible-gzip-vary-bug-v1-5-1/245574/3 "2013-06-19T19:53:42Z")

</div>

Many thanks Maxim, sometimes the solution is so easy. I was using SPDY  
and  
only checked with latest Firefox and Chrome. And one shouldn’t trust  
Page  
Speed, it keeps telling me about the vary headers, although it’s using  
SPDY.  
Again, many thanks.

Posted at Nginx Forum:

> **[Re: Possible gzip\_vary bug? (v1.5.1)](https://forum.nginx.org/read.php?2,240214,240223#msg-240223)**
>
> 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....
