nginx配置:访问静态文件 403 forbidden

nginx配置:

    server {
            listen 443;
            server_name localhost;
            ssl on;
            ssl_certificate /home/attolee/sslkey/example.crt;
            ssl_certificate_key /home/attolee/sslkey/example.key;
            ssl_session_timeout 5m;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_ciphers ALL:!ADH:!EXPORT56:-RC4+RSA:+HIGH:+MEDIUM:!EXP;
            ssl_prefer_server_ciphers on;

            location / {
                    root /home/a;
                    index index.html;
            }

            location /b/ {
                    root /home/a;
                    index b.html;
            }
   }

我想让

  1. https://host/可以访问到/home/a/index.html,

  2. https://host/b可以访问到/home/a/b/b.html,

现在1成功,2没有成功,403 Forbidden,请问,配置哪里出了问题?

更新

更详细的问题描述:403 forbidden of nginx in ubuntu

阅读 8.9k
3 个回答

root需要x权限:

d--------x  2 attolee attolee  4096 11月  2 21:54 hi/
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题