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

index index.php;
try_files $uri $uri/ /index.php;

location ~^(/page/).*(\.php)$ {
  try_files  $uri $uri/ /index.php;
}

location /interface/ipsconnect/ipsconnect.php {
  deny all;
}

location ~^(/uploads/).*(\.php)$ {
  deny  all;
}

location ~^(/hooks/).*(\.php)$ {
  deny  all;
}

location ~^(/cache/).*(\.php)$ {
  deny  all;
}

location ~^(/screenshots/).*(\.php)$ {
  deny  all;
}

location ~^(/downloads/).*(\.php)$ {
  deny  all;
}

location ~^(/blog/).*(\.php)$ {
  deny  all;
}

location ~^(/public/style_).*(\.php)$ {
  deny  all;
}

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

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