I’ve been receiving this error message Gateway Timeout. The Gateway did not receive a timely response from the upstream server or application on several WordPress websites and I decided to figure out how to fix this and found a solution. This is the typical error message I would get:
When I tried to update a plugin I would also get this error:
Let me quickly explain my WordPress setup. I am using various VPS server hosting providers (Azure, AWS, Online Hosting Solutions) with Ubuntu 22.04.3 LTS and HestiaCP as the control panel. Some of the VPS servers have multiple domains hosted and HestiaCP is a great tool for managing this. I previously used VestaCP but this is no longer supported hence the reason for using HestiaCP. HestiaCP uses apache and nginx as the web platform. The setup is pretty straight forward but there is a setting on apache that causes the Timeout issue. There are a few options to fix this problem and you can either use SSH or HestiaCP to fix it.
SSH
Login to the VPS server via SSH
Edit the apache2 configuration file:
vi /etc/apache2/apache2.conf
Change the Timeout from 30 to 60 or higher. If there is a script or application that is running for more than 30 seconds it will time out and cause the error message. Now a script shouldn’t take more than 30 seconds but if you’re running a heavy website or if you have WordPress plugins that cause a delay you may need to increase this.
You will then need to restart apache so type:
service apache2 restart
HESTIACP
You can also change this setting via the HestiaCP dashboard. Here are the steps:
Click on Server Settings
Click on the edit Apache2
At the bottom change the timeout from the default 30 to 60 or higher
OTHER TIMEOUT SETTINGS
If the above options didn’t work then you may need to also play around with other time related settings.
There are other additional timeout settings in both apache2 and nginx you need to test.
Edit the apache2 service and then click on Configure PHP
Increase the max_execution_time and the max_input_time
If the above also didn’t fix the issue there are also timeout settings in nginx so edit the nginx service
Increase the different timeout settings one by one and see if it makes a difference
The last resort would be to migrate your WordPress instance to another hosting provider as it’s possible the server could be too slow and causing the issue.
Here’s a video showing you the steps in more detail. Make sure to like the video and subscribe to the channel.
I hope this helped and if it did please share the article and subscribe to my newsletter.
If this article helped you in any way and you want to show your appreciation, I am more than happy to receive donations through PayPal. This will help me maintain and improve this website so I can help more people out there. Thank you for your help.
HELP OTHERS AND SHARE THIS ARTICLE
LEAVE A COMMENT
I am an entrepreneur based in Sydney Australia. I was born in Vietnam, grew up in Italy and currently residing in Australia. I started my first business venture Advertise Me from a random idea and have never looked back since. My passion is in the digital space, affiliate marketing, fitness and I launched several digital products. You will find these on the portfolio page.
I’ve decided to change from a Vegetarian to a Vegan diet and started a website called Veggie Meals.
I started this blog so I could leave a digital footprint of my random thoughts, ideas and life in general.
If any of the articles helped you in any way, please donate. Thank you for your help.
Affiliate Compensated: there are some articles with links to products or services that I may receive a commission.