enabling SPDY (patch 42) +nginx 1.3.2 breaks gzip

Valentin V. Bartenev ne at vbart.ru
Tue Jun 26 23:53:13 UTC 2012

On Tuesday 26 June 2012 23:43:15 pgndev wrote:
> hi
> On Tue, Jun 26, 2012 at 12:23 PM, Valentin V. Bartenev <ne at vbart.ru> wrote:
> > Actually, Firefox doesn't* send the "Accept-Encoding" header over SPDY
> I'm not clear as to that statement's implication ... Can you please
> clarify what's not working with Firefox+SPDY ?

Firefox doesn't send "Accept-Encoding" header and according to the SPDY 
specification it's not needed for using gzip compression. So, there's
nothing wrong with Firefox.

But, since you pass requests over HTTP and compression handled by your upstream 
servers, thus the lack of this header results in an uncompressed response.

> Do I need to change/add something to headers in FF config as well?

No, you don't.

> Fwiw, I already have installed this extension:
>   https://github.com/chengsun/moz-spdy-indicator
> Does that not address this issue?

No, it doesn't. It's just an icon in your address bar.

> > and Nginx doesn't add it when proxying to backend.
> ok
> > * Note, that Firebug isn't accurate about the headers have actually been
> > sent.
> That's useful to know.  Do you have some more detail on this?  I can
> take it up @firebug if it hasn't been already

As I already mentioned, Firebug shows "Accept-Encoding gzip, deflate" as a 
request header, when it actually hasn't been sent.

But I don't think that it's a bug. Probably, it's a feature. Firebug just
isn't the right tool for low level debugging of browser-server communication.

Firebug shows not only real headers but also those "implied".

> > The issue is clear enough and will be fixed in the future revision.
> > Currently, you can use something like this:
> > 
> >    map $spdy $spdy_ae {
> >        default  $http_accept_encoding;
> >        2        "gzip, deflate";
> >    }
> > 
> >    proxy_set_header Accept-Encoding $spdy_ae;
> I've added that stanza to my nginx "http{..." conf.  Cleared
> all-caches & restarted server.
> I'm still seeing no gzip headers:

Since you added the "proxy_set_header" directive to "http" section, you should 
make sure that it is not overridden by the directives on other levels.

Please note: "These directives are inherited from the previous level if and only 
if there are no proxy_set_header directives defined on the current level."

 wbr, Valentin V. Bartenev

More information about the nginx-devel mailing list