0 votes
131 views
by Talented
I am getting regular 504 gateway errors from NginX when updating 20+ of the 1,000 or so WooCommerce products on my site, at the same time. My idea was to increase the following timeout values by adding the file `/etc/nginx/conf.d/timeout.conf` and restarting the NginX service.

proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

This would apply it globally, so I would prefer to make this 'fix' on a per-domain basis. How should I do this with Webinoly, or maybe this is not the correct fix, or the way to do it.

Your advice, as always, would be much appreciated.

1 Answer

0 votes
by Expert

Hi Terence,

Whatever you put in conf.d folder will have a global effect, Webinoly have support for Custom Nginx rules per site, for example: /var/www/domain.com/custom-nginx.conf, you can read about this feature, here: https://webinoly.com/en/documentation/sites/#nginx

I don't think that Proxy Nginx directives will solve your issue (I may be wrong), because your WordPress sites are not using the Reverse Proxy configuration in Nginx.

What I recommend in this case, is that first of all you should check the PHP logs and of course Webinoly have support for it: sudo log -php, because I think PHP is not responding for some reason. We have two variables for this:

  • max_execution_time  (/etc/php/7.3/fpm/php.ini)
  • request_terminate_timeout (/etc/php/7.3/fpm/pool.d/www.conf)

Both of them are set to a value of 300 seconds (5 minutes), so I think that this time is more than enough to process almost any individual request, for this reason, I think this is not the cause of your issue, but you should consider it. 

If you prefer, you can found the PHP logs here: /var/log/php/7.3/fpm.log for more details.

Also, we have an NGINX directive fastcgi_read_timeout (/etc/nginx/conf.d/fastcgi.conf) that we have set to 30 seconds, maybe you should try increasing this value. Don't forget to restart Nginx to changes take effect sudo nginx -t && sudo service nginx reload.

Finally, you should check your server resources, maybe its time to migrate to a bigger server.

Please, tell me if you have any additional question and keep me posted if you solve this issue.

Regards.

by Talented

It turned out to be a PHP problem generated by a plugin which is not 7.3 compatible, which explains the other errors we were seeing.  The advice I got from the author was "PLease switch the PHP version to 7.1. It will solve the issue."  When I did that it started to run as it should do. Its a shame really because that means quite a performance hit which I have seen on my page load speed. Hopefully he will get with the program eventually.

by Expert

Glad to see your issue solved!

  • The BAD: You should try to avoid using "poorly coded" plugins.
  • The GOOD: With Webinoly is really easy switch the PHP versión.
Regards.
by Talented
edited by

As always, thank you for your excellent help.

P.S. Sometimes poorly coded plugins are all us non-developers have to choose from. laugh

by Expert

Hi Terence,

Just came to my mind this issue now when I saw that PHP 7.1 will be EOL (End Of Life) in 2 more weeks (Dec 1st), which means that no updates and not even security patches will be released after this date.

You should plan your upgrades to 7.3.

Regards.

by Talented
Thanks for remembering me.  I have written to them but I am not hopeful of hearing anything positive. In fact I am not hopeful of hearing anything. Their actions and attitudes appear to me to be more like a company with a business model of "price low and provide minimal support". They stand in stark contrast to you and Webinoly.
Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...