Nginx With Gzip On Ubuntu Jaunty

I just noticed that the latest version of Nginx available on Jaunty repositories was [1] the latest legacy version (0.6.x) instead of the latest stable version (0.7.x), and [2] not compiled with gzip compression enabled.

To solve both problems, I had to compile Nginx from source with --with-http_gzip_static_module option. By default, Nginx would be installed at /usr/local. I would rather keep the locations consistent with those used in the precompiled packages from the repositories, so I ended up having to use the following configure options:

sudo make install
nginx path prefix: "/usr"
nginx binary file: "/usr/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/lib/nginx/body"
nginx http proxy temporary files: "/var/lib/nginx/proxy"
nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi"

And voila.

foo> nginx -v
nginx version: nginx/0.7.67

The gzip settings in my nginx.conf:

    gzip  on;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_proxied any;
    gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers 16 8k;
Share Comments
comments powered by Disqus