Laravel在nginx访问页面报404错误

Laravel在nginx访问页面报404错误

在nginx的项目conf的location /里面加上 try_files $uri $uri/ /index.php?$query_string;

如果配置文件中存在 try_files $uri $uri/ =404;需要将它注释掉或者删掉,否则会报错

    location /{
        root /root/laravel_test/public;
        index index.html index.htm index.php;
        try_files $uri $uri/ /index.php?$query_string; 
    }

 phpstudy中配置如下:

Laravel在nginx访问页面报404错误

注意:配置之后重启nginx服务才生效

相关文章:

  • 2021-09-08
  • 2021-08-30
  • 2021-08-17
  • 2021-10-29
  • 2021-09-08
  • 2021-09-29
  • 2021-09-25
  • 2021-09-20
猜你喜欢
  • 2021-10-07
  • 2021-08-17
  • 2021-08-01
  • 2021-09-25
  • 2021-08-17
  • 2021-12-22
  • 2021-10-29
  • 2021-09-25
相关资源
相似解决方案