server { listen 80 default_server; server_name localhost; root /var/www/html/public; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log; index index.html index.php; client_max_body_size 5M; location / { try_files $uri $uri /index.php$is_args$args; } location ~ ^/.+\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } include fastcgi_params; fastcgi_pass php-test-docker-app:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; fastcgi_param REALPATHTEST $realpath_root; internal; } }