Laravel5.5升级碰到5.6的问题
如果你在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;