Skip to content

Instantly share code, notes, and snippets.

@githubcom13
Created April 28, 2023 03:22
Show Gist options
  • Save githubcom13/74798dc7ab846d970e1a2709aefd01c1 to your computer and use it in GitHub Desktop.
Save githubcom13/74798dc7ab846d970e1a2709aefd01c1 to your computer and use it in GitHub Desktop.
Solution for NGINX error 404 and "FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client:"
add the line fastcgi_param
root /var/html/www/my-website
location ~ \.php$ {
# return 200 $document_root$fastcgi_script_name; // uncomment and download the php file and read the link inside the file. Make the necessary corrections
# fastcgi_param SCRIPT_FILENAME /var/html/www/my-website/$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment