root /home/u1/domains/example.com;

location / {
  try_files $uri $uri/ @rewrite;
}

location @rewrite {
  rewrite ^/(.*)$ /index.php?title=$1;
}

location ^~ /maintenance/ {
  return 403;
}

location ~ \.php$ {
  fastcgi_param PATH_INFO $path_info;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  fastcgi_index index.php;
  include fastcgi.conf;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  try_files $uri /index.php;
  expires max;
  log_not_found off;
}

location = /_.gif {
  expires max;
}

location ^~ /cache/ {
  deny all;
}

location /dumps {
  root /home/u1/domains/example.com/local;
  autoindex on;
}

location ~ /\.svn {
  deny all;
}

location ~ /\.git {
  deny all;
}

location ~ /\.hg {
  deny all;
}
