3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00
Files
snipe-it/config/trustedproxy.php
2026-07-22 15:12:16 +01:00

68 lines
2.3 KiB
PHP

<?php
/*
|--------------------------------------------------------------------------
| DO NOT EDIT THIS FILE DIRECTLY.
|--------------------------------------------------------------------------
| This file reads from your .env configuration file and should not
| be modified directly.
*/
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy
* that connects directly to your server,
* a requirement when you cannot know the address
* of your proxy (e.g. if using ELB or similar).
*
* The "**" character is syntactic sugar within
* TrustedProxy to trust not just any proxy that
* connects directly to your server, but also
* proxies that connect to those proxies, and all
* the way back until you reach the original source
* IP. It will mean that $request->getClientIp()
* always gets the originating client IP, no matter
* how many proxies that client's request has
* subsequently passed through.
*/
'proxies' => env('APP_TRUSTED_PROXIES') !== null ?
explode(',', env('APP_TRUSTED_PROXIES')) : '*',
/*
* To trust one or more specific proxies that connect
* directly to your server, use an array of IP addresses:
*/
// 'proxies' => ['192.168.1.1'],
/*
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
// 'proxies' => '*',
/*
* Trusted forwarded-header list intentionally not configured here.
*
* The runtime defaults trust X-Forwarded-For, X-Forwarded-Host,
* X-Forwarded-Port, X-Forwarded-Proto, and the AWS ELB set. This is
* the right answer for essentially every reverse-proxy deployment,
* so there is nothing to change under normal circumstances.
*
* Older versions of this file shipped a commented-out example
* referencing Illuminate\Http\Request::HEADER_X_FORWARDED_ALL. That
* constant was removed from Symfony (see symfony/symfony#38928) and
* uncommenting the example produced a fatal "Undefined constant"
* error. It has been removed to avoid the foot-gun. See #6852.
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
];