Skip to content

Instantly share code, notes, and snippets.

@bst27
Created June 15, 2025 17:07
Show Gist options
  • Save bst27/4ec19a6fc00acc55cd720f3bb3ee4f99 to your computer and use it in GitHub Desktop.
Save bst27/4ec19a6fc00acc55cd720f3bb3ee4f99 to your computer and use it in GitHub Desktop.
Laravel E-Mail verification fails with: 403 Invalid signature

If you use Laravel (Jetstream) with user email verification enabled and you get this error 403 Invalid signature when you want to confirm an user email address, you should check if you are executing your Laravel application behind a reverse proxy (e.g. Traefik, Caddy). Some cloud services like Heroku, Coolify or AWS ELB do this, too.

In this case you have to configure Laravel to trust the reverse proxy. This will fix the problem:

<?php // file: bootstrap/app.php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        api: __DIR__.'/../routes/api.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->trustProxies('*'); // Add this to trust all proxies
    })
    ->withExceptions(function (Exceptions $exceptions) {
        //
    })->create();

Reference: Laravel Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment