mivita/config/trustedproxy.php
2025-08-12 18:01:59 +02:00

48 lines
1.3 KiB
PHP

<?php
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' => null, // [<ip addresses>,], '*'
/*
* 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' => '*',
/*
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
*
* In Laravel 11, instead of using constants, we use an array of trusted headers.
* This replaces the old HEADER_X_FORWARDED_ALL constant.
*/
'headers' => [
'for' => 'X-Forwarded-For',
'proto' => 'X-Forwarded-Proto',
'host' => 'X-Forwarded-Host',
'port' => 'X-Forwarded-Port',
'prefix' => 'X-Forwarded-Prefix',
'aws_cloud_front_for' => 'CloudFront-Forwarded-For',
],
];