- Plesk for Linux
A website fails to load with the following error in a browser:
PLESK_INFO: 504 Gateway Time-out (nginx)
A WordPress PHP file is failed to be executed with the same error.
The following errors can be found in the logfile
# grep "Connection timed out" /var/www/vhosts/system/example.com/logs/proxy_error_log
[error] 1096#0: *25 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 203.0.113.2, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/example.com/php-fpm.sock", host: "example.com"
There are a lot of similar error messages across all domains:
# grep -R "upstream timed out" /var/www/vhosts/*/logs/ | wc -l
Insufficient timeout limits for nginx.
If the issue occurs with one domain, increase timeout limits on a domain level:
In Plesk go to Domains > example.com > Apache & nginx Settings and add the following directives to the Additional nginx directives field:
CONFIG_TEXT: proxy_connect_timeout 1200s;
Apply the changes.
If the issue occurs with several/all domains, increase timeout limits globally:
Connect to a Plesk server via SSH.
Create a backup of the original file nginx.conf:
# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old
Open the file
/etc/nginx/nginx.confin any text editor and add the following directives inside the
CONFIG_TEXT: proxy_send_timeout 1200s;
Restart the nginx service:
# service nginx restart