server { set $projectLocation /var/www/localhost/htdocs/current; server_name localhost; client_max_body_size 10M; client_body_buffer_size 1024k; location / { root $projectLocation/public; error_log /var/log/nginx/localhost-error.log; access_log /var/log/nginx/localhost-access.log; location ~ ^/(.*)$ { try_files $uri /index.php =404; fastcgi_pass php:9000; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; } } }