gpt4 book ai didi

nginx - 尽管设置了权限,但 Nginx 出现 403 禁止错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:24:04 24 4
gpt4 key购买 nike

我的实际问题是 Nginx 无法呈现页面(403 禁止),尽管 nginx:nginx 的权限设置为 755。

我正在使用以下命令...

[root@wfe1 user1]# strace -p 26934 -e trace=file
Process 26934 attached
stat("/home/user1/site3/index.html", {st_mode=S_IFREG|0755, st_size=6, ...}) = 0
open("/home/user1/site3/index.html", O_RDONLY|O_NONBLOCK) = -1 EACCES (Permission denied)

如您所见,输出是 Permission Denied。我想知道使用哪个用户帐户访问该文件?我怎样才能深入挖掘?

[root@wfe1 user1]# ls -al site3
total 8
drwxr-xr-x. 2 nginx nginx 23 Mar 6 06:12 .
drwx------. 5 user1 user1 4096 Mar 6 06:12 ..
-rwxr-xr-x. 1 nginx nginx 6 Mar 6 06:12 index.html

最佳答案

查看 nginx 访问日志,看看哪里出了问题

使用ps aux | grep nginx 查看正在运行的 nginx 用户。

确保您在 nginx 配置/位置节中设置了正确的“允许所有”权限。

关于nginx - 尽管设置了权限,但 Nginx 出现 403 禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35858675/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com