From 2ac478919cdb1a9a9524f068e2b08c65a872c197 Mon Sep 17 00:00:00 2001 From: ahsinirshad22 Date: Wed, 5 Nov 2025 12:08:45 +0500 Subject: [PATCH] Revert "trust all proxies" This reverts commit c19b2b7c8fdb92f4cc64105746ae3283ebd3892d. --- app/Http/Middleware/TrustProxies.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index a32ed71..3391630 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -10,18 +10,19 @@ class TrustProxies extends Middleware /** * The trusted proxies for this application. * - * Using '*' trusts all proxies, which is safe when behind a managed reverse proxy like Coolify. - * * @var array|string|null */ - protected $proxies = '*'; + protected $proxies; /** * The headers that should be used to detect proxies. * - * This ensures Laravel correctly detects HTTPS and client IP forwarded by Coolify. - * * @var int */ - protected $headers = Request::HEADER_X_FORWARDED_ALL; + protected $headers = + Request::HEADER_X_FORWARDED_FOR | + Request::HEADER_X_FORWARDED_HOST | + Request::HEADER_X_FORWARDED_PORT | + Request::HEADER_X_FORWARDED_PROTO | + Request::HEADER_X_FORWARDED_AWS_ELB; }