Skip to content

Commit

Permalink
Set trusted proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmanders committed Aug 7, 2024
1 parent a1073cb commit 523e2c8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Request;

return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
web: __DIR__ . '/../routes/web.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(
at: '*',
headers: Request::HEADER_X_FORWARDED_FOR
| Request::HEADER_X_FORWARDED_PORT
| Request::HEADER_X_FORWARDED_PROTO
);

$middleware->web(append: [
HandleInertiaRequests::class,
]);
Expand Down

0 comments on commit 523e2c8

Please sign in to comment.