发布于 5年前

laravel 5.5 升级到laravel 5.7 步骤

  1. 修改 composer.json

    "fideloper/proxy": "~3.3",
    "laravel/framework": "5.5.*",

    改为:

    "fideloper/proxy": "^4.0",
    "laravel/framework": "5.7.*",
  2. 执行命令 composer update

  3. 修改 app\Http\Middleware\TrustedProxies.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;
©2020 edoou.com   京ICP备16001874号-3