【问题标题】:403 Forbidden Error using nginx使用 nginx 出现 403 禁止错误
【发布时间】:2015-11-13 08:35:12
【问题描述】:

我正在尝试让 nginx 服务器用于 Web 应用程序测试,但由于某种原因,我不断收到 403: Forbidden 错误。我已将其简化为我认为应该工作的基本内容,这意味着只有一个 index.html 文件,没有后端服务器或其他任何东西。这是我的 nginx.conf 文件:

worker_processes  1;

events {
    worker_connections  1024;
}

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

    sendfile        on;

    keepalive_timeout  65;

    server {
        listen       8080;
        server_name  localhost;
        root         /Users/turner/Documents/;
        index        index.html;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

}
include servers/*;

我的 Documents 文件夹中有一个 index.html,所以这不是问题。我在此处和其他地方查看了有关此问题的大量问题,但要么他们没有解决我的问题,要么我对 nginx 还不够熟悉,无法使用它们。

如果我可以提供任何进一步的信息可以使这个问题变得更好,请告诉我。

【问题讨论】:

  • 您能否检查一下您的错误日志文件,让我们知道您在域的 nginx 错误日志文件中遇到了什么确切错误?

标签: web-applications nginx


【解决方案1】:

也许 nginx 用户没有合适的权限来访问这个目录(或者它被加密了,例如使用 ecryptfs)

【讨论】:

  • 嗨,我刚看到这个 - 抱歉!有没有办法检查这是否是问题?如果有任何想法我会如何去纠正它?
  • sudo -u www-data ls -la /Users/turner/Documents/
猜你喜欢
  • 2013-07-19
  • 2021-01-13
  • 2015-02-02
  • 1970-01-01
  • 2016-01-12
  • 1970-01-01
  • 2016-03-26
  • 1970-01-01
  • 2021-08-24
相关资源
最近更新 更多