Skip to content
Help Center

504 Gateway Timeout – How to Fix This Error

If your website frequently shows errors, there's likely a solution. Learn about the 504 Gateway Timeout error and how to fix it.

The tech world is much broader than we think — when we browse the web, we only see the tip of the iceberg. Behind every click or request, there is a systematic chain that handles the connection between your server and the web page. However, in some cases this fast process is disrupted, causing the Error 504 Gateway Timeout. Here we provide details and guidance on this type of error.

At some point, we have all seen this particular error notification, which prevents us from accessing the website we want. It usually leaves us in a state of uncertainty, not knowing what caused it or how to fix it. It affects us even more when our own website is generating the error.

Like any failure, the 504 Gateway Timeout Error has a cause and a solution. The key is understanding what it is and acting efficiently to resolve the underlying problem. You don't need to be an IT professional to understand the error and work toward a solution.

What is HTTP Error 504 Gateway Timeout?

Let me emphasize the word «timeout». A timeout error indicates that something has taken too long to complete, and the server ended the process before it finished normally. It all comes down to the communication between the server and the website — a procedure that should be instantaneous exceeds the allotted time to finish.

In this situation, your website generates a 504 error. Now, the question is...

Who is to blame for the 504 Gateway Timeout error?

This is a complicated question to answer because the 504 error is very generic and requires additional investigation. But based on our experience, in 70% of cases where our clients experience the 504 error, it is our fault — NOT THE CLIENT'S WEB. So generally, the solution lies in the hands of the hosting company.

That said, there is a 30% of cases where it is the client's website itself that, due to how slowly it operates, ends up generating the timeout error.

Doesn't my website speed depend on my hosting?

Partially. And this is very important for you to understand. Changing hosting companies can speed up your site — or make it slower — depending on how well you choose. But what is certain is that if your site is fast, it will be fast on every host; if it is slow, it will be slow on every host.

How can my website be slow and generate a 504 error?

Imagine your website has the goal of calculating the decimal digits of the number PI. That is your website's job. How long will it take to respond? Well, it depends… on how many decimals you want to calculate. If you calculate PI with 2 decimal places, your website will surely respond in milliseconds. However, if your goal is to break the record for decimal digits of PI (the current record required 121 days and 25 virtual machines to obtain), then you will force a 504 error, because no hosting company will allow a process to run for 121 days. As this simple example shows, YES, YOUR WEBSITE CAN BE SLOW — simply because what it needs to do is too complex, poorly programmed, or trying to do too many things at once.

In practice, what should I do to speed up my website?

I will frame this answer in the WordPress environment, which is the most common. It is very common to see clients filling their WordPress sites with dozens of plugins. Each plugin adds workload to your site, and as you add more plugins, your site becomes slower and slower. Our recommendation is to remove plugins you don't need. Like magic, your site will start running much faster, and 504 errors will instantly disappear or decrease significantly.

What different error messages can appear?

The error may appear on your website with the following messages:

504 Gateway Timeout nginx

Gateway Timeout Error

HTTP Error 504

504 Gateway Time-out – The server didn’t respond in time

HTTP Error 504 – Gateway Timeout

What if the problem is with the hosting service?

Any professional hosting company is very attentive to resolving its issues, so the best course of action may be to contact your hosting provider. If you are a Bacan client, don't hesitate to write to us at ayuda@Bacan.com and let us know where the error occurs. One of our technicians will review whether the issue is on the server side, or whether your website needs improvements in its processes.

What should I do if the problem is not resolved?

If you are certain the problem is not caused by your website but by your hosting company, and despite reporting it to their technicians you don't receive an immediate solution, then the answer is clear. You need to switch hosting companies. A professional hosting service will not cause the problems you are experiencing. And since you're here, come to Bacan — you can start completely free, and guarantee with no risk whatsoever that your 504 error is truly solved!