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

location = /favicon.ico {
  log_not_found off;
  access_log off;
}

location = /robots.txt {
  allow all;
  log_not_found off;
  access_log off;
}

location / {
  try_files $uri $uri/ /index.php?it=$uri&$args;
}

location ~ \.php$ {
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $request_filename;
  fastcgi_intercept_errors on;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  try_files $uri =404;
}

location ~ /\. {
  deny all;
}

location ~ /(COPYRIGHT|LICENSE|README|htaccess)\.txt {
  deny  all;
}

location ~ ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions) {
  deny  all;
}

location ~ ^/site(-[^/]+)?/install {
  deny  all;
}

location ~ ^/(site(-[^/]+)?|wire)/(config(-dev)?|index\.config)\.php {
  deny  all;
}

location ~ ^/((site(-[^/]+)?|wire)/modules|wire/core)/.*\.(inc|module|php|tpl) {
  deny  all;
}

location ~ ^/(site(-[^/]+)?|wire)/templates(-admin)?/.*\.(inc|html?|php|tpl) {
  deny  all;
}

location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
  expires 7d;
}
