Applicable to:
- Plesk for Linux
Symptoms
-
Website example.com is not accessible. The following error is shown in a browser:
CONFIG_TEXT: 504 Gateway Time-out
-
The following error message appears in the domain error log file at Domains > example.com > Logs:
PLESK_INFO: [proxy_fcgi:error] [pid 42290:tid 140458047010560] (70007)The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to :, referer: http://example.com/gallery
-
In Plesk > Domains > example.com > PHP Settings it is shown that the website uses "FastCGI application" (and not "FPM application") PHP handler.
Cause
Execution PHP code of the website takes longer than the specified timeout.
Resolution
To fix the issue increase the timeout. FastCGI limits can be increased for an affected domain only or on a server-wide level. Both ways are described below.
Note: In case it is necessary to run only one script with the increased timeout, consider running it in a scheduled task: How to schedule a task in Plesk for Linux?
-
In Plesk, go to Domains > example.com > Apache & nginx Settings.
-
Add the following lines to the text boxes Additional directives for HTTP and Additional directives for HTTPS:
CONFIG_TEXT: FcgidIdleTimeout 1200
FcgidProcessLifeTime 1200
FcgidConnectTimeout 1200
FcgidIOTimeout 1200
Timeout 1200
ProxyTimeout 1200Note: If the website still shows "504 Gateway Timeout" try increasing timeouts to higher values.
-
Click OK button to apply the changes.
-
Open the FastCGI configuration file fcgid.conf in a text editor with a text editor such as "vi" or "nano". Location of the file depend on operating system:
-
for CentOS/RHEL/CloudLinux distributions:
CONFIG_TEXT: /etc/httpd/conf.d/fcgid.conf
-
for Debian/Ubuntu distributions:
CONFIG_TEXT: /etc/apache2/mods-enabled/fcgid.conf
-
-
Increase FastCGI timeout limits as shown below:
CONFIG_TEXT: FcgidIdleTimeout 1200
FcgidProcessLifeTime 1200
FcgidConnectTimeout 1200
FcgidIOTimeout 1200 -
Test configuration with "
apachectl configtest"
command, and it should return the following:# apachectl configtest
Syntax OK -
Restart Apache:
-
for CentOS/RHEL-based operating systems:
# service httpd restart
-
for Debian/Ubuntu-based operating systems:
# service apache2 restart
-
Comments
10 comments
i already do that but always i have the same issue
thanks in advance
Hello yassine, try to increase values. It is also could be site code issue.
that not solve the probem. it is happening in only one domain
@Luis, is the error is the same as in symptoms?
[Mon Dec 17 23:48:53.485341 2018] [proxy_fcgi:error] [pid 22656] (104)Connection reset by peer: [client :34694] AH01075: Error dispatching request to :
[Mon Dec 17 23:48:54.168827 2018] [proxy_fcgi:error] [pid 22839] [client :34698] AH01067: Failed to read FastCGI header
[Mon Dec 17 23:48:54.227130 2018] [proxy_fcgi:error] [pid 22839] (104)Connection reset by peer: [client :34698] AH01075: Error dispatching request to :
[Mon Dec 17 23:48:54.882126 2018] [proxy_fcgi:error] [pid 22655] [client :34700] AH01067: Failed to read FastCGI header
[Mon Dec 17 23:48:54.882196 2018] [proxy_fcgi:error] [pid 22655] (104)Connection reset by peer: [client :34700] AH01075: Error dispatching request to :
[Mon Dec 17 23:48:54.883449 2018] [proxy_fcgi:error] [pid 22653] [client :34702] AH01067: Failed to read FastCGI header
[Mon Dec 17 23:48:54.883490 2018] [proxy_fcgi:error] [pid 22653] (104)Connection reset by peer: [client :34702] AH01075: Error dispatching request to :
[Mon Dec 17 23:48:57.088702 2018] [proxy_fcgi:error] [pid 22656] [client :34708] AH01067: Failed to read FastCGI header
[Mon Dec 17 23:48:57.088775 2018] [proxy_fcgi:error] [pid 22656] (104)Connection reset by peer: [client :34708] AH01075: Error dispatching request to :
[Mon Dec 17 23:48:58.560174 2018] [proxy_fcgi:error] [pid 22657] [client :34710] AH01067: Failed to read FastCGI header
[Mon Dec 17 23:48:58.560239 2018] [proxy_fcgi:error] [pid 22657] (104)Connection reset by peer: [client :34710] AH01075: Error dispatching request to :
Hello @iamkingsleyf
The provided error messages may have different causes do you have any other issue details?
In case you have WordPress website, please, try this article: https://support.plesk.com/hc/en-us/articles/115000452434-WordPress-website-shows-503-Service-Temporarily-Unavailable
Also, please try to change PHP version of the website.
no details, i follow this tutorial and restarted my server, so far its working
Hello,
every night should run an importscript but i got this error:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
this part i did it, but without success:
If FPM PHP handler is used create
/etc/httpd/conf.modules.d/00-proxy_timeout.conf
then add the following lines into it:Timeout 600
this are my php-settings:ProxyTimeout 600
Hello @Dashmir Kasa!
As I can see, you have already created a request to Plesk technical support.
Please expect an update in the ticket.
The article is aware of Debian/Ubuntu, but only lists the CentOS*-style path for FPM (/etc/httpd/conf.modules.d/00-proxy_timeout.conf).
Please sign in to leave a comment.