The --compressed flag is adding &quot;<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Accept-Encoding: deflate, gzip&quot; to the request. </span><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Your test shows</span></font><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> that nginx is working fine. </span></font><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">It is compressing the content if it receives an Accept-Encoding: gzip field, and doesn&#39;t if not. This is valid behaviour. </span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">However, Chrome *should* be sending an Accept-Encoding field just like curl --compressed. You can confirm this using the dev tools. </span></font><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">If it is, and you don&#39;t get a Content-Encoding: gzip header in the response on Chrome (indicating compression), and if that curl test you performed was run on local interface to nginx, then it is almost certainly an HTTP proxy that&#39;s interfering. </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; "><br></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">If otoh, you got those results running the curl test remotely so that it too went through the proxy (a useful confirmation test if you didn&#39;t), then I&#39;m not so sure.</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Cheers</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Thomas</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><br><div class="gmail_quote">On 14 May 2011 18:22, jfix <span dir="ltr">&lt;<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for your replies, I will try to provide more information (I&#39;m<br>
quite new with nginx).<br>
<br>
Traffic passes through the company firewall/proxy server, so potentially<br>
things could get mangled there.  I guess  there is no way to inspect the<br>
requested headers as received by the server? I set the error_log level<br>
to debug_http, but it doesn&#39;t seem to log headers.<br>
<br>
One interesting detail: Using curl and explicitly requesting a<br>
compressed response like this, I get this result:<br>
<br>
M:&gt;curl -v --compressed <a href="http://example.org/" target="_blank">http://example.org/</a><br>
* About to connect() to <a href="http://example.org" target="_blank">example.org</a> port 80 (#0)<br>
*   Trying xx.xx.xx.xx... connected<br>
* Connected to <a href="http://example.org" target="_blank">example.org</a> (xx.xx.xx.xx) port 80 (#0)<br>
&gt; GET / HTTP/1.1<br>
&gt; User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l<br>
zlib/1.2.3<br>
&gt; Host: <a href="http://example.org" target="_blank">example.org</a><br>
&gt; Accept: */*<br>
&gt; Accept-Encoding: deflate, gzip<br>
&gt;<br>
&lt; HTTP/1.1 200 OK<br>
&lt; Server: nginx<br>
&lt; Date: Sat, 14 May 2011 16:10:06 GMT<br>
&lt; Content-Type: text/html; charset=UTF-8<br>
&lt; Transfer-Encoding: chunked<br>
&lt; Connection: keep-alive<br>
&lt; Vary: Accept-Encoding<br>
&lt; Content-Encoding: gzip<br>
&lt;<br>
10.107.145.6 - - [14/May/2011:18:10:06 +0000] &quot;GET / HTTP/1.1&quot; 200 2671<br>
&quot;-&quot; &quot;curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81<br>
zlib/1.2.3 &quot;-&quot; &quot;0.031&quot; &quot;2.53&quot;<br>
<br>
where the last item &quot;2.53&quot; is the compression ratio.<br>
<br>
M:&gt;curl -v --compressed <a href="http://example.org/resource/style/global.css" target="_blank">http://example.org/resource/style/global.css</a><br>
* About to connect() to <a href="http://example.org" target="_blank">example.org</a> port 80 (#0)<br>
*   Trying xx.xx.xx.xx... connected<br>
* Connected to <a href="http://example.org" target="_blank">example.org</a> (xx.xx.xx.xx) port 80 (#0)<br>
&gt; GET /resource/style/global.css HTTP/1.1<br>
&gt; User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l<br>
zlib/1.2.3<br>
&gt; Host: <a href="http://example.org" target="_blank">example.org</a><br>
&gt; Accept: */*<br>
&gt; Accept-Encoding: deflate, gzip<br>
&gt;<br>
&lt; HTTP/1.1 200 OK<br>
&lt; Server: nginx<br>
&lt; Date: Sat, 14 May 2011 16:14:38 GMT<br>
&lt; Content-Type: text/css<br>
&lt; Transfer-Encoding: chunked<br>
&lt; Connection: keep-alive<br>
&lt; Vary: Accept-Encoding<br>
&lt; Last-Modified: Fri, 13 May 2011 16:00:36 GMT<br>
&lt; Expires: Thu, 31 Dec 2037 23:55:55 GMT<br>
&lt; Cache-Control: max-age=315360000<br>
&lt; Content-Encoding: gzip<br>
<br>
10.107.145.6 - - [14/May/2011:18:14:38 +0000] &quot;GET / HTTP/1.1&quot; 200 7917<br>
&quot;-&quot; &quot;curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81<br>
zlib/1.2.3 &quot;-&quot; &quot;0.000&quot; &quot;5.48&quot;<br>
<br>
So, this means that compression does work in theory, but it doesn&#39;t<br>
unless I request it. The following example is the same as the previous<br>
one, but without the --compressed:<br>
<br>
M:&gt;curl -v <a href="http://example.org/resource/style/global.css" target="_blank">http://example.org/resource/style/global.css</a><br>
* About to connect() to <a href="http://example.org" target="_blank">example.org</a> port 80 (#0)<br>
*   Trying xx.xx.xx.xx... connected<br>
* Connected to <a href="http://example.org" target="_blank">example.org</a> (xx.xx.xx.xx) port 80 (#0)<br>
&gt; GET /resource/style/global.css HTTP/1.1<br>
&gt; User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l<br>
zlib/1.2.3<br>
&gt; Host: <a href="http://example.org" target="_blank">example.org</a><br>
&gt; Accept: */*<br>
&gt;<br>
&lt; HTTP/1.1 200 OK<br>
&lt; Server: nginx<br>
&lt; Date: Sat, 14 May 2011 16:16:59 GMT<br>
&lt; Content-Type: text/css<br>
&lt; Connection: keep-alive<br>
&lt; Vary: Accept-Encoding<br>
&lt; Content-Length: 43345<br>
&lt; Last-Modified: Fri, 13 May 2011 16:00:36 GMT<br>
&lt; Expires: Thu, 31 Dec 2037 23:55:55 GMT<br>
&lt; Cache-Control: max-age=315360000<br>
<br>
10.107.145.6 - - [14/May/2011:18:16:59 +0000] &quot;GET / HTTP/1.1&quot; 200 43345<br>
&quot;-&quot; &quot;curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81<br>
zlib/1.2.3 &quot;-&quot; &quot;0.000&quot; &quot;-&quot;<br>
<br>
I&#39;m not sure what the --compressed option translates to in terms of<br>
headers, but it makes a difference. The last examples is what I get when<br>
I user a browser (Chrome and Firefox tested).<br>
<br>
Thanks for your help,<br>
Jakob.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,197898,198024#msg-198024" target="_blank">http://forum.nginx.org/read.php?2,197898,198024#msg-198024</a><br>
<div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>