# Duplicate Vary: Accept-Encoding header

**URL:** <https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/235488>\
**Category:** NGINX\
**Created:** [June 25, 2013, 8:52am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/235488 "2013-06-25T08:52:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [June 25, 2013, 8:52am UTC](https://www.ruby-forum.com/t/duplicate-vary-accept-encoding-header/235488/1 "2013-06-25T08:52:34Z")

</div>

I use nginx 1.4.1 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:

user@aladin:~$ curl -I -A test [http://192.168.56.249/](http://192.168.56.249/)  
HTTP/1.1 302 Found  
Server: nginx  
Date: Tue, 25 Jun 2013 06:45:12 GMT  
Content-Type: text/html  
Connection: keep-alive  
Vary: Accept-Encoding  
Location: index.htm  
Vary: Accept-Encoding

I have no control of the upstream server maybe it sends 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.

Posted at Nginx Forum:

> **[duplicate Vary: Accept-Encoding header](https://forum.nginx.org/read.php?2,240322,240322#msg-240322)**
>
> I use nginx 1.4.1 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: user@aladin:~$ curl -I -A test http://192.168.56.249/ HTTP/1.1 302 Found Server: nginx Date:
