Fixing “504 Gateway Timeout” Errors On Plesk With Nginx

If your Plesk server is configured to run Nginx in from of Apache then you may encounter “504 Gateway Timeout” errors when executing long running PHP pages.  Nginx is acting as a reverse proxy for Apache. The “proxy_read_timeout” configuration setting in Nginx controls how long Nginx will wait for Apache to return a response. The default is 60 seconds which may be too short if you have a script that takes several minutes to run. To increase this timeout, just edit /etc/nginx/nginx.conf and add the highlighted line:

Don’t forget to restart Nginx after making the change.

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

One Response

  1. We migrated our PHP web app from Rackspace to AWS a few months ago, but we are facing failures such as backend errors and gateway timeout. AWS support seem unhelpful. Is there any third-party service that can review & solve our problems?

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.