Please use the official NGINX documentation, guides and examples to start with: https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info
Loading PHP-FPM the right way. Replace the location
regex with this:
location ~ ^(.+\.php)(.*)$
Make sure you include this, for the WebDAV/API FileRun to work fine:
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
And also this:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;