Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx/fastcgi 504 gateway error, increasing fastcgi_read_timeout isn't helping

Tags:

php

nginx

fastcgi

I need the timeout to be high so I can use a debugger on my source code. It's getting passed to fastcgi from nginx correctly, but always times out after 60 seconds. I've changed as many timeout parameters as I could find, restarted nginx and fast-cgi after every change and nothing worked.

I see most users point questions like this to How do I prevent a Gateway Timeout with FastCGI on Nginx. But that solution did not work for me.

The parameters I've increased are:

  • fastcgi_read_timeout (the above thread says this fixed the issue for that user)
  • client_header_timeout
  • client_body_timeout
  • send_timeout
like image 573
joshm1 Avatar asked Sep 08 '11 15:09

joshm1


People also ask

How do I fix Nginx 504 Gateway Timeout error?

A 504 error means nginx has waited too long for a response and has timed out. There might be multiple reasons for the problem. Possible fixes include: Increasing the nginx proxy_read_timeout default of five minutes to be longer, for example, to 10 minutes.

How do I increase my gateway timeout?

For example, you want to increase request timeout to 300 seconds. Then you need to add proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout directives to http or server block. Here the http block allows the changes in all server in NGINX.

Why does a 504 Gateway Timeout occur?

The HyperText Transfer Protocol (HTTP) 504 Gateway Timeout server error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.


1 Answers

Have you checked the max_execution_time value in php.ini?

That's the only other configurable value I can think of that might be causing a timeout.

like image 112
Jonathan Chan Avatar answered Nov 03 '22 23:11

Jonathan Chan