How To Fix 504 Gateway Time-out on Nginx

r00t December 9, 2014

Fix 504 Gateway Time-out on Nginx

If you run a Nginx web server you may have already encountered the annoying 504 Gateway Time-out errors. This is pretty common error, are generated most probably by the PHP max execution time limit or by the FastCGI read timeout settings. This tutorial shows you how to fix nginx 504 gateway timeout on the nginx webserver.

Fix 504 Gateway Time-out on Nginx

Changes in php.ini

Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):

Changes in PHP-FPM

Try raising request_terminate_timeout setting in php.ini file (CentOS path is /etc/php-fpm.d):

Changes in Nginx Config

Finally, add fastcgi_read_timeout variable inside our Nginx virtual host configuration:

Reload PHP-FPM and Nginx

Congratulation’s! You have successfully fix error nginx 504 gateway time out. Thanks for using this tutorial for fix 504 gateway timeout error in CentOS system. For additional help or useful information, we recommend you to check the official Nginx web site.

Nginx Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “Nginx Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

Share on Google+2Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit1Pin on Pinterest1
The Tags:

Leave a Comment