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
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
相关文章推荐
- Nginx 访问php文件返回404 Not Found错误
- Nginx配置error_page 404 500等自定义的错误页面
- nginx 自定义404 500 错误页面
- nginx 下使用laravel 需要配置.conf文件,否则无法访问指定路由(不知道说路由是否合适,刚学的小白,tp中对应的应该方法)
- 当浏览不存在的页面时,系统会报404错误,返回的404错误不友好,如何自定义与中不同的404页面?
- nginx 设置错误的自定义404页面跳转到500
- 解决wampserver + laravel无法访问自定义路由
- Laravel 5.5 FormRequest 自定义错误消息
- Laravel之路由 Route::get/post/any、路由参数、过滤器、命名、子域名、前缀、与模型绑定、抛出 404 错误、控制器
- 利用Nginx负载均衡的访问SpringBoot服务,还有如何利用Nginx实现404,500等错误页面的拦截
- laravel dingo API返回自定义错误信息
- Lumen 框架路由访问一直报404错误
- nginx后端服务器返回给nginx502、504、404、执行超时等错误状态的解决方法
- nginx 、apache、tomcat自定义返回错误页面配置
- Yii自定义错误页面(403,404)和NGINX 配置404错误页面转向
- Laravel 5.5 FormRequest 自定义错误消息
- laravel配置NGINX路由出现404解决办法
- wordpress 在nginx服务器下重写路由,解决设置固定链接后出现404错误
- nginx后端服务器返回给nginx502、504、404、执行超时等错误状态的解决方法
- nginx 、apache、tomcat自定义返回错误页面配置