我有一个简单的 Flask/Nginx 服务器和 3 个文件位置/opt/hosting/files
:
[adam@localhost]$ namei -om /opt/hosting/files
f: /opt/hosting/files
dr-xr-xr-x root root /
drwxr-xr-x root root opt
drwxr-xr-x root root hosting
drwxr-xr-x nginx nginx files
在文件夹中files
,我有 3 个文件:两个图像和一个更大的 zip 文件:
[adam@localhost]$ ls -lh /opt/hosting/files/
total 424M
-rwx-----x. 1 nginx nginx 19K 03-06 01:29 file1.jpg
-rwx-----x. 1 nginx nginx 18M 03-06 03:34 file2.png
-rwxr-xr-x. 1 nginx nginx 406M 07-07 13:07 file3.zip
我正在提供这些文件,而前两个似乎没有问题,我403 Forbidden
通过 www 和使用 wget 获取 zip 文件。我认为目录权限设置正确,因为其他两个文件都很好。Zip 文件的属性甚至更高,因此这也不应该成为问题。
我尝试将chown root:root
andchown 777
用于文件和文件夹,但无论如何都无法访问该文件。进行更改后,我正在重新启动 nginx sudo systemctl restart uwsgi
。SELinux 显示Enforcing
.
这里有什么问题?