【已解决】

网站部署一直404 403

段大帅

新增网站,添加index.php 和index.html都是 403或者 404

问题比较着急?请联系QQ:760483
  • 段大帅
  • 段大帅    2021-04-29 15:49:523楼

    深度截图_选择区域_20210429154114.png

    +添加回复

  • 回复

    使用正常的域名搭建

    Peter·Python · 2021-04-29 15:51:27
    回复

    没发现问题

    Peter·Python · 2021-04-29 15:51:49
    回复

    我是本地环境

    段大帅  作者 · 2021-04-29 15:52:33
    回复

    那你也用正常的域名,或者去群里交流一下

    Peter·Python · 2021-04-29 15:53:11
    回复

    找到问题了,项目文件拥有者只能是www用户

    段大帅  作者 · 2021-04-29 16:47:03
    回复

    不是,那就是你权限不对

    Peter·Python · 2021-04-29 16:52:11
    回复

    有尝试777的无效 还是要改文件拥有者

    段大帅  作者 · 2021-04-29 16:53:58
    回复

    不要随便777,那是小白无脑的操作,你都用linux了,基本的权限概念要清楚

    Peter·Python · 2021-04-29 17:01:54
    回复

    哈哈哈 都是没招了就777试一下

    段大帅  作者 · 2021-04-29 17:49:00
    回复
  • 段大帅
  • 段大帅    2021-04-29 15:49:192楼

    server{

    listen 80 ;

    server_name test ;

    root /www/admin/test_80/wwwroot/ ;

    #301重定向

    #rewrite ^(.*)$ $1 permanent;

    #强制SSL

    #rewrite ^(.*)$  https://$host$1 permanent;

    #防盗链

    location / {

    #伪静态

    #include /www/admin/test_80/wwwroot/.rewrite.conf;

    #首页

    root /www/admin/test_80/wwwroot/;

    index index.php index.html error/index.html;

    }

    #流量限制

    #日志

    access_log /www/admin/test_80/log/nginx_access_$logdate.log main;

    error_page  403  /error/403.html;

    error_page  400  /error/400.html;

    error_page  404  /error/404.html;

    error_page  502  /error/502.html;

    error_page  503  /error/503.html;

    #处理PHP

    location  ~ [^/]\.php(/|$) {

    root /www/admin/test_80/wwwroot/;

    fastcgi_pass 127.0.0.1:7221;

    fastcgi_split_path_info  ^(.+\.php)(.*)$;

    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_param  PATH_INFO $fastcgi_path_info;

    include fastcgi.conf;

    }

    #DenyFiles

    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)

    {

    return 404;

    }

    }

    深度截图_选择区域_20210429154737.png

    +添加回复

  • 回复
  • Peter·Python
  • Peter·Python  已被采纳  2021-04-29 15:38:391楼

    路径不对

    +添加回复

  • 回复

    路径没错的

    段大帅  作者 · 2021-04-29 15:39:41
    回复

    那你具体说一下你的配置过程,要详细的

    Peter·Python · 2021-04-29 15:44:49
    回复

    我把配置贴楼下

    段大帅  作者 · 2021-04-29 15:46:48
    回复

    没看到

    Peter·Python · 2021-04-29 15:47:27
    回复

    大佬帮看下

    段大帅  作者 · 2021-04-29 15:50:09
    回复