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

时间:2015-02-03 13:16:32

标签: 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;
    }
  }
}

你对我如何解决这个问题有任何建议吗?

1 个答案:

答案 0 :(得分:6)

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

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

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

相关问题