0

I tried to host WordPress Directory but it didn't work. So i tried to get a simple index.php with phpinfo() in it to run. But if i try to access it, i get a blank site with the Words "File not found." My Nginx Error Log says:

*12 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

But i don't know what i should do to fix that. I changed my Nginx Site Conf as follows:

location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location /wp {
    root /var/www/html/;
    try_files $uri $uri/ /index.php;
}

Any help is appreciated.

EDIT:

I tried to do this "For those who don't understand exactly how the variable might be wrong: add to main Nginx http section the following: log_format scripts '$document_root$fastcgi_script_name > $request'; (or whatever you're feeding to SCRIPT_FILENAME), and to your server: access_log /var/log/nginx/scripts.log scripts. Reload and take a look at your new scripts log ;) "

Like mentioned in the linked Thread and my Log says

/var/www/html/wp/ > GET /wp/ HTTP/2.0
/home/user/Documents/vue_website/dist/favicon.ico > GET /favicon.ico HTTP/2.0

Which is not what i want if i understand it correctly. I don't know if i did it right, but the main goal for me is: If i go to my-domain.com it should show me the website stored at /home/user/Documents/vue_website/dist and if i visit my-domain.com/wp it should show the Content of /var/www/html which is and index.php of WordPress.

Subby
  • 13
  • 4
  • Does this maybe help? [Nginx 1 FastCGI sent in stderr: “Primary script unknown”](https://serverfault.com/questions/517190/nginx-1-fastcgi-sent-in-stderr-primary-script-unknown) – digijay Nov 26 '19 at 23:27
  • Not really, i actually think i am on the wrong path there. I explained my actual Plan and i am thinking that this is not the right place to look for errors if i am correct. – Subby Nov 27 '19 at 18:54

0 Answers0