From 0115f32833c7f60ca396faee6527d4a24e474f29 Mon Sep 17 00:00:00 2001 From: ISMAIL MASSERAN Date: Tue, 1 Sep 2026 10:33:00 +0800 Subject: [PATCH] DONE: trust all proxies --- .env.staging | 8 ++++---- app/Http/Middleware/TrustProxies.php | 2 +- app/Providers/AppServiceProvider.php | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env.staging b/.env.staging index 0be6b95c..61ae2c3c 100644 --- a/.env.staging +++ b/.env.staging @@ -3,14 +3,14 @@ APP_ENV=staging APP_VERSION=v2.2-staging APP_KEY=base64:O1XZDqK4H6+3GdrODgCaLr2l+OoWvgVhYr0GJ1KizW8= APP_DEBUG=true -APP_URL=http://172.16.6.200:8091 +APP_URL=https://staging.erahn.com.my HTTP_PORT=8091 MYSQL_PUBLISH_PORT=3309 -API_URL=http://172.16.6.200:8090 -API_URL_KOOP=http://172.16.6.200:8090 -API_URL_PKB=http://172.16.6.200:8090 +API_URL=https://api-staging.erahn.com.my/api/ +API_URL_KOOP=https://api-staging.erahn.com.my/api/ +API_URL_PKB=https://api-staging.erahn.com.my/api/ API_ARRAHNBID=http://lelong.test/api/ LOG_CHANNEL=stack diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 14befceb..39816113 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -12,7 +12,7 @@ class TrustProxies extends Middleware * * @var array|string|null */ - protected $proxies; + protected $proxies = '*'; /** * The headers that should be used to detect proxies. diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5bc..539a3f28 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,6 +23,8 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + if (strpos((string) config('app.url'), 'https://') === 0) { + \Illuminate\Support\Facades\URL::forceScheme('https'); + } } }