После настройки локального сервера для разработки на php, nginx вроде как смотрит в нужную директорию по нужному порту, но не имеет прав на работу с файлами, как я понял.
Мой dkfire.local
server {
listen 80;
server_name dkfire.local;
root /home/dkfire/code/php/dkfire;
index index.php index.html;
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Логи nginx:
2024/03/10 14:32:25 [crit] 7708#7708: *1 stat() "/home/dkfire/code/php/dkfire/" failed (13: Permission denied), client: 127.0.0.1, server: dkfire.local, request: "GET / HTTP/1.1", host: "dkfire.local"
2024/03/10 14:32:25 [crit] 7708#7708: *1 stat() "/home/dkfire/code/php/dkfire/index.php" failed (13: Permission denied), client: 127.0.0.1, server: dkfire.local, request: "GET / HTTP/1.1", host: "dkfire.local"
2024/03/10 14:32:25 [crit] 7708#7708: *1 stat() "/home/dkfire/code/php/dkfire=" failed (13: Permission denied), client: 127.0.0.1, server: dkfire.local, request: "GET / HTTP/1.1", host: "dkfire.local"
2024/03/10 14:32:25 [error] 7708#7708: *1 open() "/home/dkfire/code/php/dkfire404" failed (13: Permission denied), client: 127.0.0.1, server: dkfire.local, request: "GET / HTTP/1.1", host: "dkfire.local"
Спасибо за ответы!