NGINX-PHP

PHP.conf

upstream php {
server unix:/run/php/php7.4-fpm.sock;
server 127.0.0.1:9000;
}

PHP.ini

!Important!

cgi.fix_pathinfo=0

Website.conf

location / {
    # This is cool because no php is touched for static content.
    try_files $uri $uri/ /index.php?$args;
}

location ~ .php(.*)$ {
    fastcgi_intercept_errors on;
    fastcgi_pass php;
    fastcgi_index index.php;
    fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    include fastcgi_params;
}