码迷,mamicode.com
首页 > 其他好文 > 详细

Laravel5.5升级碰到5.6的问题

时间:2018-11-29 15:05:37      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:forward   request   分享图片   更改   src   打开   stp   php   com   

技术分享图片

如果你在laravel5.5 升级到laravel5.6之后出现这个错误,打开app\Http\Middleware\TrustProxies.php

更改以下内容

protected $headers = [
Request::HEADER_FORWARDED => ‘FORWARDED‘,
Request::HEADER_X_FORWARDED_FOR => ‘X_FORWARDED_FOR‘,
Request::HEADER_X_FORWARDED_HOST => ‘X_FORWARDED_HOST‘,
Request::HEADER_X_FORWARDED_PORT => ‘X_FORWARDED_PORT‘,
Request::HEADER_X_FORWARDED_PROTO => ‘X_FORWARDED_PROTO‘,
];

修改为
protected $headers = Request::HEADER_X_FORWARDED_ALL;

Laravel5.5升级碰到5.6的问题

标签:forward   request   分享图片   更改   src   打开   stp   php   com   

原文地址:https://www.cnblogs.com/tengjian/p/10037459.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!