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

zerophreak's avatar

Load balanced setup - 504 gateway error

Hi together,

I have an issue with 504 gateway timeout errors.

What is happening:

  1. We use Laravel and Laravel Nova with the Excel (Export) package for Nova
  2. When trying to export datasets of 10.000+ rows with complex relationships, the execution time goes above 60 seconds and the export breaks because of a timeout. On the server, not on the local machine
  3. The error is a 504 gateway timeout

Server setup:

  • Laravel Forge
  • DigitalOcean
  • One load balancer
  • Two application servers
  • One database server

Now, on all 4 servers, the PHP maximum execution time is set to 300 seconds. However, the script breaks ALWAYS at exactly 60 seconds. It feels like there is a configuration that needs to be changed on the loadbalancer itself.

Now, how can we identify what configuration parameter needs to be changed and how?

Thanks in advance!

0 likes
1 reply

Please or to participate in this conversation.