When configuring a LEMP (Nginx, MySQL, FPM) on Ubuntu 16.04, version 7 of PHP and FPM and when I went to do a test with php, the nginx log throws this at me.
2016/08/08 22:54:50 [error] 2251 # 2251: * 4 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: fanut.localhost , request: "GET / HTTP / 1.1", upstream: "fastcgi: //127.0.0.1: 9000", host: "fanut.localhost"
I leave the configuration of my virtual Host because I read that it is from the fastcgi script but I can not find what is happening to it. Thanks in advance.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/user/html/proyecto/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name proyecto.localhost www.proyecto.localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# # With php7.0-cgi alone:
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}