Nginx不提供图像(403 - 禁止错误)

man*_*ent 3 nginx

我刚刚建立了一个nginx服务器.我可以访问我的网页("正在建设中"页面),但是虽然一个图像是服务器正确服务器(名为"logo.png"),但是同一目录中的另一个图像(我在nginx的根目录下有所有内容)不服务并抛出"403 - 禁止"错误).下面我将向您展示我的nginx.conf文件中的"http"部分.

http {

  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;

  keepalive_timeout  65;

  server {
    listen       80;
    server_name  ***********.com;
    root html;

    location / {
        index  index.html index.htm;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

你对我怎么解决这个问题有什么建议吗?

小智 7

可能nginx-user无权读取第二个文件.选项:

1)更改该文件的chmod,以便每个人都可以阅读

2)将nginx-user和file-owner-user添加到同一组,并允许组读取该文件