fix(framework): 修正 TrustProxies 配置以解決 HTTPS 識別問題
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 42s

This commit is contained in:
2026-01-29 10:04:32 +08:00
parent 90cb7a82de
commit 95a1763d04

View File

@@ -8,8 +8,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Spatie\Permission\Exceptions\UnauthorizedException; use Spatie\Permission\Exceptions\UnauthorizedException;
use Inertia\Inertia; use Inertia\Inertia;
// 信任所有代理(用於反向代理環境)
TrustProxies::at('*');
return Application::configure(basePath: dirname(__DIR__)) return Application::configure(basePath: dirname(__DIR__))
->withRouting( ->withRouting(
@@ -18,6 +16,9 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware): void { ->withMiddleware(function (Middleware $middleware): void {
// 信任所有代理(用於反向代理環境)
$middleware->trustProxies(at: '*');
// Tenancy 必須最先執行,確保資料庫連線在 Session 讀取之前建立 // Tenancy 必須最先執行,確保資料庫連線在 Session 讀取之前建立
$middleware->web(prepend: [ $middleware->web(prepend: [
\App\Http\Middleware\UniversalTenancy::class, \App\Http\Middleware\UniversalTenancy::class,