Websites hosted on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired: [client 0.0.0.0:54] AH01095: Error dispatching request !!!!!
Websites hosted on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired: [client 0.0.0.0:54] AH01095: Error dispatching request !!!!!
Date posted: 10 /10 /2019
Introduction
Most importantly, websites hosted on Plesk server is unavailable and often result in 504 Bad gateway error with timeout error specified as expired in the Plesk server.
Root cause
Execution PHP code of the website takes longer than the specified timeout.
Moreover, check the log files /var/log/nginx/error.log
Therefore, website xxx.com is not accessible. Similarly, the following error is shown in a browser:-
504 Gateway Time-out
Sample error log:
For instance, the sample error log is attached here,
[proxy_fcgi:error] [pid 46670:tid 45342478964134] (10009)The timeout specified has expired: [client 0.0.0.0:54] AH01095: Error dispatching request to :, referer: http://xxx.com/dark chocolate
Solution
However To fix the issue permanently increase the timeout of FastCGI limits.
Server-wide Fix:
For all the domains in Plesk
- Primarily, connect to the server using SSH
- Open the FastCGI configuration file fcgid.conf in your favorite text editor.
- For CentOS/RHEL, Open the following file and edit it.
/etc/httpd/conf.d/fcgid.conf - Certainly, for Debian/Ubuntu. Open the following configuration file and edit it.
/etc/apache2/mods-enabled/fcgid.conf - After that, increase FastCGI timeout limits as guided below,
FcgidIdleTimeout 600
FcgidProcessLifeTime 600
FcgidConnectTimeout 600
FcgidIOTimeout 600 - In addition, 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
ProxyTimeout 600 - Above all, test configuration with “
apachectl configtest"
, after making any changes
# apachectl configtest
Syntax OK - In conclusion, restart Apache based on OS distributions:
# service httpd restart
# service apache2 restart
Thanks for using pheonix solutions.