This step is only required if you have already un-commented request_terminate_timeout parameter. So let’s find out where to make these changes. But in case you are using NGINX, we need to make this change at 2 more places. If you are using Apache, applications running PHP as a module above would be adequate. (press “i”, navigate to the line, make the change and save it by pressing ESC and typing wq! then enter.) max_execution_time = 300 Now, search for the max_execution_time (press / and type max_execution_time).įind the right line and change the max_execution_time to 300. Open the php.ini file using Vim editor by using the following command: For Ubuntu 14.04 or PHP 5 sudo vim /etc/php5/fpm/php.ini For Ubuntu 16.04 LTE or PHP 7.0 sudo vim /etc/php/7.0/fpm/php.ini PHP default is the 30s and you need to increase it to 300. You need to make a change in the php.ini files. You can check the official documentation of NGINX to configure error logging.įix 504 Gateway Timeout Nginx Error 1. Note: Setting up error logs plays a significant role in identifying server errors. Here are the steps that you can follow to increase the time and handle HTTP requests. I faced a similar issue with my WordPress website, and it took me two days to resolve. You even might need the help of webmaster or ISP.
#Nginx gateway timeout how to
This issue is really frustrating and sometimes you do not find any clue to how to resolve it. It means that a server upstream that is acting as a gateway to handle HTTP requests is either down or too slow to manage requests.
If you have a large website setup or a server with limited resources, 504 Gateway Timeout Nginx Error can be seen quite often.