Это мои сайты-доступны/MYSERVER, правильно связаны с сайтов с поддержкой/MYSERVER:PHP7 FPM и Nginx - Получение ошибки 404
server {
listen 80;
server_name sub.domain.net;
location/{
root /home/tyrion/saveup-compute;
index index.php index.html index.htm
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/username/myServer/$fastcgi_script_name;
include fastcgi_params;
}
}
Я пошел в PHP файл футов в минуту и установить 660 и WWW-данные и установить chown в моем каталоге на www-data: myuser. Тем не менее, я не могу обслуживать один файл php. (html работает просто отлично).
Nginx Access Log:
MYIP - - [15/Sep/2016:23:09:13 +0000] "GET /info.php HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
Nginx Error Log:
2016/09/15 23:09:13 [error] 38415#38415: *2 open() "/home/myUser/myServer/404.html" failed (2: No such file or directory), client: 62.155.132.7, server: sub.somain.net, request: "GET /info.php HTTP/1.1", host: "sub.somain.net"
php7.0-fpm.log:
[15-Sep-2016 21:54:49] NOTICE: fpm is running, pid 35917
[15-Sep-2016 21:54:49] NOTICE: ready to handle connections
[15-Sep-2016 21:54:49] NOTICE: systemd monitor interval set to 10000ms
[15-Sep-2016 22:56:58] NOTICE: Terminating ...
[15-Sep-2016 22:56:58] NOTICE: exiting, bye-bye!
[15-Sep-2016 22:56:58] NOTICE: configuration file /etc/php/7.0/fpm/php-fpm.conf test is successful
[15-Sep-2016 22:56:58] NOTICE: fpm is running, pid 37925
[15-Sep-2016 22:56:58] NOTICE: ready to handle connections
[15-Sep-2016 22:56:58] NOTICE: systemd monitor interval set to 10000ms
следует попробовать попробовать 'try_files $ uri $ uri//index.php? $ Args;' или что-то в этом роде – Perspective
Вы уверены, что ваши файлы находятся в '/ home/tyrion/save-compute'? Используете ли вы какую-либо маршрутизацию 'mod_rewrite'? – Blake
Нет mod_rewrite, но, возможно, я должен это рассмотреть. – nottinhill