server { listen 8080; server_name localhost; index index index.php index.html index.htm; root /var/www/app/p/; location ~ ^.+?\.php(/.*)?$ { fastcgi_pass unix:/var/run/php/php-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location / { try_files $uri $uri/ index.php; } }