fix(framework): 修正 TrustProxies 配置以解決 HTTPS 識別問題
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user