Nginx 504 gateway error

It seems that your code took long time to run. You can:

  1. Add these to nginx.conf (Menu > Nginx > nginx.conf), below client_max_body_size … line

http {


        fastcgi_buffers 8 128k;

fastcgi_buffer_size 128k;

fastcgi_connect_timeout 600;

fastcgi_send_timeout 600;

fastcgi_read_timeout 600;


  1. Increase the number of PHP processes: Add this below [nginx] section in usr\laragon.ini (Menu > Laragon > Settings file: laragon.ini):



  1. Restart Nginx

Let me repeat the initial point one more time. While you can easily increase timeouts and “hide” the Nginx upstream timed out (504: Connection timed out) while reading response header from upstream from your logs, the clients and your users will be experiencing big delay. In most case when you see this error (response not generated within default 60 seconds window), it means you need to look what happens in your upstreams (apps) and fix underlying problems.

Was this helpful?

0 / 0