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

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

location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  return 403;
}

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

location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ {
  access_log       off;
  expires          10d;
  break;
}

location ~ /\. {
  deny all;
}
