Skip to content

Instantly share code, notes, and snippets.

@ilhamsj
Last active September 16, 2022 15:27
Show Gist options
  • Save ilhamsj/44c709d0b807c2ead4522f5a9078119e to your computer and use it in GitHub Desktop.
Save ilhamsj/44c709d0b807c2ead4522f5a9078119e to your computer and use it in GitHub Desktop.
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

From my end need to setup the root /var/www/WordPress/; and
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

$document_root required

server {
    listen 80;
    server_name localid.blog.com;
    root /var/www/WordPress/;

    location / {
        index index.php;
    }

    location ~ \.php$ {
        # fastcgi_param SCRIPT_FILENAME /opt/homebrew/var/www/site/$fastcgi_script_name;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        include fastcgi_params;
        fastcgi_pass unix:/opt/homebrew/var/run/php-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment