微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么即使启用了自动索引,在缺少index.html的目录中也会出现403错误

如何解决为什么即使启用了自动索引,在缺少index.html的目录中也会出现403错误

以下是location的{​​{1}}块的一些内容

/etc/Nginx/sites-available/example.com

那么如何阻止http://example.com/some-directory-without-index-html-file/出现403错误

location / { root /var/www/example.com/html; index index.html; autoindex on; autoindex_exact_size off; } 内容包括

/var/log/Nginx/Nginx.vhost.error.log

2020/08/22 22:41:45 [error] 3821#3821: *30539 directory index of "/var/www/example.com/html/my-directory/" is forbidden,client: 73.204.11.250,server: example.com,request: "GET /my-directory/ HTTP/1.1",host: "example.com"

输出
Nginx -T

第18行是下面的“包含”语句...

2020/08/23 23:04:08 [emerg] 89824#89824: open() "/etc/Nginx/mime.types" Failed (2: No such file or directory) in /etc/Nginx/Nginx.conf:18
Nginx: configuration file /etc/Nginx/Nginx.conf test Failed

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。