http {
  perl_modules perl;

  # Get this module from the CPAN and put the file in this directory.
  # or install it systemwide
  perl_require Javascript/Minifier.pm;
  perl_require Minify.pm;

  root /var/www;
  server {
    location / {
      index  index.html index.htm;
    }

    location ~ \.js$  {
      perl Minify::handler;
    }
  }
}
