• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

SeoWebMaster

New Pleskian
Hello,

I have some Prestashop 1.6 online shops and when I have to run some long scripts like creating products with many combinations or generating sitemap I get a "504 Gateway Time-out."

I have increased max_execution_time to 300 and set some nginx variables in Additional nginx directives as suggested in other threads, but it doesn't work: it gets the error always after 60 seconds.
Code:
proxy_connect_timeout 1200s;
proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;

What am I missing?

Versions:
OS: CentOS Linux 7.6.1810 (Core)
PHP: 7.0.33, run as FPM served by Apache
 
It is possible that Apache is timing out, not Nginx. Try to add
TimeOut 1200
to the Apache configuration and see if this helps. By default this is set to 300, in Plesk I think it is set to 120 or less.

It will be helpful to see the log entries of
proxy_error_log
proxy_access_log
access_log
error_log
at the time when the error happens. There may be additional hints on what exactly is causing the timeout.
 
Hello,
thank you for your reply.
Since I am a newby in plesk, where do I set TimeOut for Apache.

In the meantime, I've checked the logs and now I get Server Error 503 Service Temporarily Unavailable:
2019-04-05 07:57:20 - Error - (70007)The timeout specified has expired: AH01075: Error dispatching request to :, referer: https://example.com/../&configure=gsitemap&tab_module=seo&module_name=gsitemap Apache error
2019-04-05 07:56:20 - Error - 503 POST /../..&tab_module=seo&module_name=gsitemap HTTP/1.0
 
Are you sure that your scripts are working correctly? Very frequently scripts are buggy and don't return any output, which will cause the symptoms described here.
 
I am pretty sure. They are standard functions of different versions of Prestashop. It happens for different functions like I said: generating all the variations of products, generating long sitemaps when I want to check also for images. It always stops after exactly 60s.

Going back to the previous answer, I tried to find Timeout and ProxyTimeout variables in httpd.conf file, but I cannot find them. I am checking on this specific file /etc/httpd/conf/httpd.conf. Where can I add them? At the end of the file?
 
On CentOS those variables are not defined in httpd.conf, they are left at default values.
Simply create a file in /etc/httpd/conf.d/, for example timeouts.conf and put the values in there. And then reload Apache with:
apachectl configtest && apachectl graceful

Please note: I suggest you start by only putting a value for "Timeout" first, because according to the Apache Docs, "ProxyTimeout" takes the value of "Timeout" by default:
mod_proxy - Apache HTTP Server Version 2.4
 
Hello,
thank you for your reply.
I did exactly as you suggested: I created timeout.conf file in /etc/httpd/conf.d/ and added just:
Code:
Timeout 300
Afterward, I run the command:
Code:
apachectl configtest && apachectl graceful
But, after 60 seconds, I got "504 Gateway Time-out nginx" error.
From the logs, I got this:
5109#0: *1876715 upstream timed out (110: Connection timed out) while reading response header from upstream - nginx error
 
Thank you for your reply.
Now, it's working. After adding timeout variable as you suggested, and adding the directives in Additional nginx directives (in Apache & nginx Settings), it works as it should, finally.
Thank you!
 
Back
Top