I have Ubuntu with Nginx installed. I have not deploy any site and just GET default Nginx static page.

Here is Nginx settings:

# Gzip Settings

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
gzip_comp_level 4;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

I am checking compression using http://www.gidnetwork.com/tools/gzip-test.php (my site to test http://demas.me) and it say that the response is not compressed.

Google Developers Tools says:

enter image description here

Why the compression does not work ?



Full Nginx configuration: http://pastebin.com/D7xjzwAf

  • I accessed the site with my browser, and I also got the GZiped response just like LinuxDevOps. – Tero Kilkanen Mar 22 '14 at 17:33
  • How do you know that the response is GZiped ? – demas Mar 22 '14 at 17:35
  • 1
    Using HTTPFox, I can see that the response headers contain Content-Encoding: gzip -header. I also tested another site with the testing tool you mentioned, and it tells that the site is not sending compressed versions either, although I'm 100% positive it is using compression. So it seems that the online tool doesn't work. – Tero Kilkanen Mar 22 '14 at 17:38

On testing your site, I find that the response is compressed with gzip.

Your screenshot shows a cached response. Clear your browser cache and try again.

As for the tool, the reason it is not getting a compressed response is that it sent an HTTP/1.0 request to your server, rather than an HTTP/1.1 request. By default nginx only sends gzipped responses to HTTP/1.1 requests. (And HTTP/1.1 is over 15 years old, so anything like that that's still sending HTTP/1.0 requests is hopelessly obsolete or broken.)


Your site is accepting gzip/deflate, it looks compressed to me, why so you think differently?

  • 1) the site gidnetwork.com/tools/gzip-test.php says that it is not compressed 2) YSlow Chrome plugin says that it is not compressed 3) Response Header doesn't include Content-Encoding: gzip header (see Google Chrome Dev screenshoot) – demas Mar 22 '14 at 17:11
  • Response headers do not have Content-Encoding header, so the response is not compressed. Did you mean that the client accepts gzip/deflate? – Tero Kilkanen Mar 22 '14 at 17:12
  • @TeroKilkanen It was answer to me or to LinuxDevOps ? :) – demas Mar 22 '14 at 17:19
  • (btw I mean to post a comment not an answer). Right, in the screenshot the client accepts gzip but the server is not including Content-Encoding, I can see it though when I make the request: HTTP/1.1 200 OK Server: nginx/1.4.1 (Ubuntu) Date: Sat, 22 Mar 2014 17:23:54 GMT Content-Type: text/html Last-Modified: Mon, 06 May 2013 10:26:49 GMT Transfer-Encoding: chunked Connection: keep-alive Content-Encoding: gzip – LinuxDevOps Mar 22 '14 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.