您的位置:首页 > 运维架构 > Nginx

Laravel5.5在nginx访问自定义路由返回404错误

2018-06-07 20:06 811 查看
Laravel5.5在nginx访问自定义路由返回404错误:



nginx解决办法:

在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;
}



重启nginx:

systemctl restart nginx

访问:http://192.168.1.172/welcome

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐