Nginx 403 访问受限问题

今天瞎搞,配置了一个文件虚拟目录,结果访问文件一直报403错误,用了好多种方法,终于解决,做个笔记。

  • 1.文件授权:
chmod 777 /home/image/
  • 2.Nginx授权(nginx.conf):
user  root;
  • 3.Nginx域名配置:
server
    {
    listen 443 ssl;

    ssl_certificate /home/xxxx.crt;
        ssl_certificate_key /home/xxxx.key;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        #listen [::]:80 default_server ipv6only=on;
        server_name res.apiopen.top;
        index index.html index.htm index.php;
        root  /home/image/;

        #error_page  404 https://www.xxxxx.top/404;
        include enable-php.conf;


        location / {  
        index  index.html index.htm  index.php;
        autoindex  on;  
        }  


        access_log  /www/wwwlogs/blogaccess.log;
    }

猜你喜欢

转载自blog.csdn.net/c__chao/article/details/79785649
今日推荐