From 805ca4e17b408012b51a8aae6084675414b1ad64 Mon Sep 17 00:00:00 2001 From: Patrick Brisacier Date: Wed, 25 Sep 2024 16:49:41 +0200 Subject: [PATCH] Enable TrustProxies middleware for private ranges to allow Laravel to see the real client IP --- app/Http/Middleware/TrustProxies.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index e85daea..779f1ce 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -12,7 +12,11 @@ class TrustProxies extends Middleware * * @var array */ - protected $proxies; + protected $proxies = [ + '10.0.0.0/8', + '172.16.0.0/12', + '192.168.0.0/16', + ]; /** * The current proxy header mappings.