Revert "trust all proxies"

This reverts commit c19b2b7c8f.
This commit is contained in:
2025-11-05 12:08:45 +05:00
parent c19b2b7c8f
commit 2ac478919c

View File

@@ -10,18 +10,19 @@ class TrustProxies extends Middleware
/** /**
* The trusted proxies for this application. * The trusted proxies for this application.
* *
* Using '*' trusts all proxies, which is safe when behind a managed reverse proxy like Coolify.
*
* @var array<int, string>|string|null * @var array<int, string>|string|null
*/ */
protected $proxies = '*'; protected $proxies;
/** /**
* The headers that should be used to detect proxies. * The headers that should be used to detect proxies.
* *
* This ensures Laravel correctly detects HTTPS and client IP forwarded by Coolify.
*
* @var int * @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;
} }