Adding config/trustedproxy.php
This commit is contained in:
parent
5554434663
commit
7019c1303f
2 changed files with 35 additions and 0 deletions
|
|
@ -12,3 +12,5 @@ DB_CONNECTION=sqlite
|
|||
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=sync
|
||||
|
||||
TRUSTED_PROXIES=127.0.0.1,1.1.1.1
|
||||
33
config/trustedproxy.php
Normal file
33
config/trustedproxy.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
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).
|
||||
*
|
||||
*/
|
||||
'proxies' => explode(',', env('TRUSTED_PROXIES')),
|
||||
|
||||
/*
|
||||
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
|
||||
*
|
||||
* Options include:
|
||||
*
|
||||
* - 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)
|
||||
*
|
||||
* @link https://symfony.com/doc/current/deployment/proxies.html
|
||||
*/
|
||||
'headers' => Request::HEADER_X_FORWARDED_ALL,
|
||||
];
|
||||
Reference in a new issue