👁 查看:TrustProxies.php
路径:/home/boguraj1/public_html/epaper/app/Http/Middleware/TrustProxies.php
大小:928 B · 修改:2026-09-01 00:43:16 · 权限:0644 · 可写
<?php

namespace App\Http\Middleware;

use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
{
    /**
     * The trusted proxies for this application.
     *
     * '*' trusts the X-Forwarded-* headers from the hosting layer (cPanel /
     * LiteSpeed / Cloudflare). Without this, Laravel sees the request as plain
     * HTTP behind an SSL proxy and builds http:// image URLs that browsers
     * block as "mixed content".
     *
     * @var array<int, string>|string|null
     */
    protected $proxies = '*';

    /**
     * The headers that should be used to detect proxies.
     *
     * @var int
     */
    protected $headers =
        Request::HEADER_X_FORWARDED_FOR |
        Request::HEADER_X_FORWARDED_HOST |
        Request::HEADER_X_FORWARDED_PORT |
        Request::HEADER_X_FORWARDED_PROTO |
        Request::HEADER_X_FORWARDED_AWS_ELB;
}