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

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

location ~* /thumbs/(.*)$ {
  try_files $uri $uri/ /app/classes/timthumb.php?$query_string;
}

location /app/classes/upload {
  try_files $uri $uri/ /app/classes/upload/index.php?$query_string;
}

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;
}

location ~ /\. {
  deny all;
}

location /app {
  deny all;
}

location ~ cache/ {
  return 403;
}

location ~ /vendor {
  deny all;
}

location ~ \.db$ {
  deny all;
}

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