That’s because the default PHP script execution time limit is only 30s (30 seconds). Surely you will often encounter Error 504 Gateway time-out in your browser when running / executing the php file. Next Next post: Setting up NAT on Amazon. If you run LEMP (Linux Nginx MySQL PHP) on your server and the nginx and php configurations are still in the default configuration.
The result is that the status code of the request is 504 gateway time out. 504 Gateway Timeout error on Nginx + FastCGI (php-fpm) Blog of Leonid Mamchenkov: http, 503, nginx, fas. It is found that a request has been processed in the background for 1 minute. NGINX file may be located at /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx depending on your installation.īonus Read : Increase File Upload Size in NGINX 2. Recently, nginx has been used in the project. Open terminal and run the following command to open NGINX configuration file in a text editor. Here are the steps to increase request timeout in NGINX.
Here’s how to increase request timeout in NGINX using proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout directives to fix 504 Gateway Timeout error. If you don’t increase request timeout value NGINX will give “504: Gateway Timeout” Error. Sometimes you may need to increase request timeout in NGINX to serve long-running requests. By default, NGINX request timeout is 60 seconds.