Why is this file not being gzipped?

mike mike503 at gmail.com
Sun Aug 24 10:54:10 MSD 2008


On 8/23/08, Igor Sysoev <is at rambler-co.ru> wrote:

> css matched by the first location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html)$

I fixed it - this is what it looks like now. I keep getting the
location ordering confused. That's probably the most confusing part of
switching to nginx for me is when something matches multiple
locations/etc... anyway, so far so good!

        server {
                listen 80;
                server_name media.xmike.com;
                index index.html;
                root /home/mike/web/media.xmike.com/;
                gzip off;
                location ~* \.css$ {
                        gzip on;
                }
                include /etc/nginx/defaults.conf;
                include /etc/nginx/expires.conf;
                location ~* ^.+\.(jpg|jpeg|gif)$ {
                        valid_referers none blocked foo.com;
                        if ($invalid_referer) {
                                return 403;
                        }
                }
        }

> BTW, do you really use such indentions ?
> If yes, then I understand Python author.

No :) I have it indented nicely, but some of those were include files,
and I decided to paste the contents of them in so you could see the
entire scope of the server block





More information about the nginx mailing list