root /home/u1/domains/example.com; location / { try_files $uri /index.php?$args; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; } } location ~ /\. { deny all; } location ~ \.php$ { try_files $uri = 404; fastcgi_pass unix:/var/run/php5-example.com.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\. { deny all; }