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

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

location /core {
  deny all;
  return 403;
}

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

location ~ \.php$ {
  try_files $uri =404;
  include fastcgi_params;
  fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  fastcgi_intercept_errors on;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
}

location ~ /\.svn {
  deny all;
}

location ~ /\.git {
  deny all;
}

location ~ /\.hg {
  deny all;
}
