访问abc.com时nginx日志显示如下错误
2023/02/18 11:28:38 [crit] 21879#0: *24748177 stat() "/disk_1/new/laravel/demo/public/" failed (13: Permission denied), client: 192.69.85.177, server: abc.com, request: "GET / HTTP/1.1", host: "abc.com"
2023/02/18 11:28:38 [crit] 21879#0: *24748177 stat() "/disk_1/new/laravel/demo/public/" failed (13: Permission denied), client: 192.69.85.177, server: abc.com, request: "GET / HTTP/1.1", host: "abc.com"
2023/02/18 11:28:38 [error] 21879#0: *24748177 open() "/disk_1/new/laravel/demo/public/favicon.ico" failed (13: Permission denied), client: 192.69.85.177, server: abc.com, request: "GET /favicon.ico HTTP/1.1", host: "abc.com", referrer: "http://abc.com/"
nginx配置如下:
server {
listen 80;
server_name abc.com;
root /disk_1/new/laravel/demo/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
#error_page 404 /index.php;
include /usr/local/nginx/conf/fastcgi.conf;
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
error_log /www/logs/abc_err.log;
}
求大神指教
出错代码里不是写了吗 Permission denied 权限问题啊,
检查 Nginx 的启动用户,和当前目录的用户和权限,