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