server { listen 80; server_name localhost; access_log /var/log/nginx/localhost.access.log; index index.php index.html index.htm; root /var/www; location / { index index.php index.html index.htm; if (!-f $request_filename) { rewrite ^(.+)$ /index.php last; break; } } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } }