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

vermichou's avatar

Suddenly, Nginx returns 504

Hey guys,

Having an issue here that I can't get my head around. Suddenly, my NGINX servers start sending back 504 and my pages lag and eventually fail to load.

If I die() just before $kernel->terminate($request, $response); in public/index.php, it's fast as it was before. My server is not overloaded, htop shows healthy metrics, so I have no idea what's happening.

Has anyone experienced something similar?

0 likes
10 replies
vermichou's avatar

Needless to say I restarted my server & haven't changed anything specific to the codebase.

vermichou's avatar

Again dying before the last line of index.php works great. Do you know what this last line does ?

jlrdw's avatar

@vermichou which line, you mean:

$response = tap($kernel->handle(
    $request = Illuminate\Http\Request::capture()
))->send();

click's avatar
  • How is your database doing? Is it running in high memory or high cpu?
  • How is your filesystem doing, are your disks (almost) full?
  • Is this local or remote? You can also get 504's if you have xdebug running and it is stuck somewhere.

Please or to participate in this conversation.