Skip to content

Commit

Permalink
Add back trustedproxy config (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 authored Oct 21, 2024
1 parent de00232 commit 3d5c8d1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions config/trustedproxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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 Rackspace balancers).
*
* 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' => in_array(env('TRUSTED_PROXIES', []), ['*', '**']) ?
env('TRUSTED_PROXIES') : explode(',', env('TRUSTED_PROXIES') ?? ''),
];

0 comments on commit 3d5c8d1

Please sign in to comment.