Patch: avoid multiple vary header entries

Maxim Dounin mdounin at
Mon Apr 11 17:49:39 MSD 2011


On Mon, Apr 11, 2011 at 02:54:21PM +0200, Daniel Bornkessel wrote:

> Hi, while using nginx & varnish together we had problems when 
> setting a 'Vary' header in our app when nginx is configured with 
> gzip_vary  on;
> as nginx's created response contain two 'Vary' header entries:
> Vary: Accept-Encoding
> Vary: X-Special
> however, several clients, including Varnish, don't understand 
> this. Instead they need one header entry:
> Vary: Accept-Encoding, X-Special

Just a side note: per RFC2616 these forms are equivalent.

> this is a patch that achieves this behavior. Is there any chance 
> getting this patch into upstream?

The patch doesn't looks correct for me.  While it probably works, 
it certainly does many unneeded things and violates at least one 
invariant concerning r->headers_out.

Maxim Dounin

More information about the nginx-devel mailing list