Articles in this section

An operation or a script that takes more than 60 seconds to complete fails on a website hosted in Plesk: nginx 504 Gateway Time-out

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms 

  • An operation or a script that takes more than 60 seconds to complete fails on a website with the following error in a web-browser:

    PLESK_INFO: nginx 504 Gateway Time-out

  • The following error message appears on the Logs page (Domains > example.com > Logs) or in the domain's nginx error logfile /var/www/vhosts/system/example.com/logs/proxy_error_log:

    CONFIG_TEXT: [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"

Cause

The default timeout limit is 60 seconds for proxying requests from nginx to Apache.

Resolution

If a script takes more than 60 seconds to execute, increase the timeout limit.

  1. Log in to Plesk.

  2. Go to Domains > example.com > Apache & nginx Settings.

  3. Add the following lines to the Additional nginx directives field to increase the timeout limit to 180 seconds (3 minutes):

    CONFIG_TEXT: proxy_connect_timeout 180s;
    proxy_send_timeout 180s;
    proxy_read_timeout 180s;
    fastcgi_send_timeout 180s;
    fastcgi_read_timeout 180s;

  4. Apply the changes.

Was this article helpful?

Comments

3 comments
Date Votes
  • It says: ; Additional directives added by Plesk Optimization Settings
    ; DO NOT MODIFY THIS FIELD BECAUSE IT WAS GENERATED AUTOMATICALLY
    ; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE BLOCK IS GENERATED.

    1
  • Still having the same issue

    1
  • This is not a fix

    2

Please sign in to leave a comment.