Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gateway Time-out:The gateway did not receive a timely response from the upstream server

I am sending 300 newsletter at a time with a url, after 2 min it refresh itself again to send next 300 at so on.

But I am getting this error:

Gateway Time-out

The gateway did not receive a timely response from the upstream server or application.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I have set max execution to 3600

ini_set('max_execution_time', 3600);

But I am regularly getting same error. Please help me to find out the solution.

like image 979
Harish Singh Avatar asked Dec 09 '13 13:12

Harish Singh


People also ask

What causes a gateway timeout?

A 504 Gateway Timeout error indicates that the web server is waiting too long to respond from another server and “timing out.” There can be many reasons for this timeout: the other server is not functioning properly, overloaded, or down. The other server need not always be external (e.g. CDN, API gateway).

What does 504 Gateway time Out mean?

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

I encountered the same problem and I used ini_set('default_socket_timeout', 6000); to fix it. http://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout

like image 200
Mario Radomanana Avatar answered Oct 07 '22 12:10

Mario Radomanana