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:
1 2 3 4 5 6 |
server_tokens off; proxy_read_timeout 300; include /etc/nginx/conf.d/*.conf; } |
Don’t forget to restart Nginx after making the change.