# Duplicate Vary: Accept-Encoding header

**URL:** <https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/238606>\
**Category:** NGINX\
**Created:** [January 20, 2014, 5:54am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/238606 "2014-01-20T05:54:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 20, 2014, 5:54am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/238606/1 "2014-01-20T05:54:25Z")

</div>

Hello,

I use nginx/1.4.4 with gunzip = on and gzip\_vary = on. This leads to a  
duplicate Vary Header.

gzip\_vary should do nothing if the header is already present:

moki@mysrv:~$ curl -I  
[http://192.168.1.196/home.html](http://192.168.1.196/home.html)[http://213.223.158.196/home.html](http://213.223.158.196/home.html)  
HTTP/1.1 200 OK  
Server: nginx/1.4.4  
Date: Sun, 19 Jan 2014 11:30:59 GMT  
Content-Type: text/html  
Connection: keep-alive  
Vary: Accept-Encoding  
Vary: Accept-Encoding  
Location: home.html

I have no control of the upstream server it may send a Vary header or  
not,  
in order to be safe I would like to use gzip\_vary = on in order to  
prevent  
any problems here.

This issue is in standard ngx\_http\_header\_filter\_module so can anyone  
suggest solution?

Thanks,  
Makailol

---

<div class="post-metadata">

**Author:** ![Makailol\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@Makailol\_C](https://www.ruby-forum.com/u/Makailol_C)\
**Post date:** [January 20, 2014, 8:42am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/238606/2 "2014-01-20T08:42:19Z")

</div>

On 20 January 2014 04:54, Makailol C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I use nginx/1.4.4 with gunzip = on and gzip\_vary = on. This leads to a  
> duplicate Vary Header.  
> [snip]  
> This issue is in standard ngx\_http\_header\_filter\_module so can anyone  
> suggest solution?

Quick question: other than looking untidy, what’s the actual problem  
that (does|can) occur when the header is duplicated?

Jonathan

---

<div class="post-metadata">

**Author:** ![Makailol\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@Makailol\_C](https://www.ruby-forum.com/u/Makailol_C)\
**Post date:** [January 20, 2014, 9:31am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/238606/3 "2014-01-20T09:31:38Z")

</div>

I have just noticed this header duplication but I could not notice any  
issue yet.

But I believe, gzip\_vary should do nothing if the header is already  
present. And it seems like a bug in core header\_filter\_module .

Makailol

On Mon, Jan 20, 2014 at 1:11 PM, Jonathan M.
