Nginx – gzip not working for some files using nginx

deflategzipnginx

Some files are not gzipped on their way to the user browser in our setup.

for example

http://myhostname.com/css/build/20120904-1.css

http://myhostname.com/js/dojo/dn/main.js?20120904-1

http://myhostname.com/js/jquery-min/compiled.js?20120725-4

can not be zipped.

my current configuration:

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)\.*+$ {
            if ($args ~ [0-9]\.*+) {
               expires max;
               break;
            }
            expires max;
            log_not_found off;
             gzip  on;
    }

What needs to be adjusted to make gzip fly?
I already tried several other options but don't want to continue with try&error on this.

Thank you very much.

Some more info:
maybe there is another problem.
Firebug and pingdom tools show me the compressed size whereas Chrome Developer Bar and Google PageSpeed Insights says "no compression active"

To make things easier, the link to the site is http://diginights.com

Best Answer

You need to set gzip_types application/x-javascript text/css; By default, nginx will only gzip text/html.