Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hsl's avatar
Level 2

Maintenance mode with --allow=[ip] behind load balancer doesn't work

I'm trying to set my own ip so that I can access my app while they are in maintenance mode. My app is running on multiple servers behind a digital ocean load balancer and the php artisan down --allow=[ip] doesn't work properly as it doesn't see the original IP for the client.

Anyone knows how to fix this?

0 likes
5 replies
hsl's avatar
Level 2

Yeah, it's been included since 5.5, but for maintenance mode it doesn't do the trick.

aurawindsurfing's avatar

It is probably due to the order of middleware in your app:

If you want to use trusted proxy prior to maintenance middleware then just change the order like so:

  protected $middleware = [
        \Fideloper\Proxy\TrustProxies::class
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    ];
hsl's avatar
Level 2

Thanks, but unfortunately that doesn't make a difference :/

digitaloutback's avatar

You also have to add the TrustedProxies to the $middlewarePriority highup as well.

Please or to participate in this conversation.