snipe-it/config/trustedproxy.php

63 lines
2.1 KiB
PHP
Raw Permalink Normal View History

<?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
2018-07-24 20:48:24 -07:00
* 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')) : '*',
/*
2018-07-24 20:48:24 -07:00
* To trust one or more specific proxies that connect
* directly to your server, use an array of IP addresses:
*/
// 'proxies' => ['192.168.1.1'],
/*
2018-07-24 20:48:24 -07:00
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
// 'proxies' => '*',
/*
2018-07-24 20:48:24 -07:00
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
*
2018-07-24 20:48:24 -07:00
* Options include:
*
2018-07-24 20:48:24 -07:00
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
* - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
*
2018-07-24 20:48:24 -07:00
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
// 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, //this is mostly handled already
2018-07-24 20:48:24 -07:00
];