Al configurar en ubuntu 16.04 un LEMP (Nginx, MySQL, FPM) la versión 7 de PHP y FPM y cuando he ido a hacer una prueba con php, el log de nginx me tira esto.
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"
Os dejo la configuración de mi virtual Host porque he leido que es del script de fastcgi pero no encuentro qué es lo que le pasa. Gracias de antemano.
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;
}
}