﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
542	NGINX won't use gzip_static when http request is proxied by NGINX and the browser is Firefox 28	frankbb.pip.verisignlabs.com		"We are having an issue with gzip_static in combination with Firefox 28 and SPDY. NGINX doesn't gzip content in one case when i expect NGINX would use gzip_static.

I will use the following file in this example:
{{{
$ ll $webroot/mxui/ui/mxui.css*
-rw-r--r-- 1 monere monere 103521 Oct 30  2012 $webroot/mxui/ui/mxui.css
-rw-r--r-- 1 monere monere  17305 Oct 30  2012 $webroot/mxui/ui/mxui.css.gz
}}}

1.) NGINX as front-facing web server that proxies to another NGINX, all unrelated config is stripped:
{{{
server {
    listen [::]:7000;
    listen 0.0.0.0:7000;
    server_name _;
    root $webroot;
}

upstream xxx {
    server 127.0.0.1:7000;
    keepalive 8;
}

server {
    listen [::]:443;
    listen 0.0.0.0:443;
    server_name $host;
    ssl_certificate [...];
    ssl_certificate_key [...];
    add_header Strict-Transport-Security ""max-age=31536000;"";
    location / {
        proxy_pass http://xxx/;
        client_max_body_size 1024M;
    }
}

gzip on;
gzip_proxied any;
gzip_disable ""msie6"";
gzip_types application/json;
gzip_static on;
}}}

I tested with three major browsers on a Windows virtual machine, Firefox 28 without SPDY, Internet Explorer 11 and Chrome 34.

http requests that are gzipped, Firefox has SPDY disabled:
{{{
$host $remote_addr - - [14/Apr/2014:16:45:07 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 17305 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 49 0.000 """"
$host $remote_addr - - [14/Apr/2014:16:46:00 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 17305 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"" ECDHE-RSA-AES128-SHA256 TLSv1.2 51 0.001 """"
$host $remote_addr - - [14/Apr/2014:16:47:55 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 17305 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36"" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 57 0.000 """"
}}}

http request that is not gzipped, this is when SPDY is enabled:
{{{
$host $remote_addr - - [14/Apr/2014:17:00:16 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 103521 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 1 0.013 """"
}}}

Response header of not working request with Firefox 28.0:
{{{
Accept-Ranges			bytes
Content-Length			103521
Content-Type			text/css
Date				Mon, 14 Apr 2014 15:00:16 GMT
Etag				""508fe716-19461""
Last-Modified			Tue, 30 Oct 2012 14:41:26 GMT
Server				nginx
X-Firefox-Spdy			3.1
strict-transport-security	max-age=31536000;
}}}

2.) When i add text/css to gzip_types the data is getting gzipped with Firefox 28 and SPDY is enabled:
{{{
- gzip_types application/json;
+ gzip_types application/json text/css;
}}}

http request:
{{{
$host $remote_addr - - [14/Apr/2014:16:53:12 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 22627 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 5 0.000 """"
}}}

{{{
Response headers:
Content-Encoding		gzip
Content-Type			text/css
Date				Mon, 14 Apr 2014 14:58:44 GMT
Last-Modified			Tue, 30 Oct 2012 14:41:26 GMT
Server				nginx
X-Firefox-Spdy			3.1
strict-transport-security	max-age=31536000;
}}}

3.) Also when i configure NGINX (Other domain, same server, same config) to serve files directly the content is gzipped by nginx:
{{{
gzip on;
gzip_proxied any;
gzip_disable ""msie6"";
gzip_types application/json;
gzip_static on;

server {
    listen [::]:443;
    listen 0.0.0.0:443;
    server_name $hostname2;
    ssl_certificate [...];
    ssl_certificate_key [...];
    root $webroot2;
}
}}}

http request:
{{{
$host $remote_addr - - [14/Apr/2014:17:51:43 +0200] ""GET /mxui/ui/mxui.css HTTP/1.1"" 200 17347 ""-"" ""Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 53 0.000 """"
}}}

Response headers:
{{{
Content-Encoding		gzip
Content-Length			17347
Content-Type			text/css
Date				Mon, 14 Apr 2014 15:03:57 GMT
Etag				""5177e3c7-43c3""
Last-Modified			Wed, 24 Apr 2013 13:53:11 GMT
Server				nginx
X-Firefox-Spdy			3.1
}}}

I would expect that NGINX would use gzip_static in case 1. If you need more information let me know.

Regards,

Frank"	defect	closed	minor		nginx-core	1.5.x	fixed			Linux custodis 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux	nginx version: nginx/1.5.13
