What to do about a 504 gateway timeout error message

Maria LeLaurin
ML
Maria LeLaurin

Aug 28, 2020 — 3 min read

Uncover all the information and solutions you need to address this common online scenario.

So, you recently went to one of your favorite websites and, instead of seeing the site you expected, you got a 504 gateway timeout error message.

Now you’re wondering why and what to do. As the name suggests, there’s a “gateway” every time you request a specific URL. Sometimes, the gateway server and the main server have a communication breakdown.

While it’s out of your hands for the most part, there are a few things you can try to resolve the issue.

A 504 gateway timeout vs. a 502 bad gateway

These two common HTTP status codes sound similar but their meanings are different. A 502 bad gateway means that the server acting as the gateway received an invalid response from the main server. A 504 gateway timeout means that the server acting as the gateway didn’t receive a response at all from the main server. You might also see a 504 show up as:

  • 504 error
  • HTTP error 504
  • gateway timeout
  • error code 504

Causes of a 504 Gateway Timeout error message

A 504 gateway timeout is almost always due to some malfunction on the server-side.

  1. DNS changes – The Domain Name System (DNS) is the communication link between domain names and IP addresses. When there are changes in the DNS, especially during server migration, the origin server may not be configured correctly.
  2. The origin server is having issues – There are a few possibilities as to why the origin server isn’t working properly. The server might be down, there could be a connectivity problem or there may be too many people on the site at the same time.
  3. The firewall is blocking safe content – A firewall’s job is to block transmission between servers and to ensure protection from malicious content. Sometimes, a firewall can mistake safe content for malicious content, which prevents you from seeing what you’re trying to access.

Here’s what you can do about a 504 error message

When the electricity goes out in your home, most of the time the outage has nothing to do with you or anything inside your home. However, one of the first things you might do is check the circuit breaker. It’s easy and it helps eliminate cause on your side. Troubleshooting a 504 is similar in that there are some simple things you can do to get to the root of the problem and move toward a solution.

6 ways to fix a 504 Gateway Timeout error

  1. Refresh the page – Just hit the refresh button usually on the left side in your browser window. You can also press F5 on your keyboard. If you just made an online payment, be careful while performing this step since you might get charged twice.
  2. Try another browser – Either start a new session or try an entirely new browser. Again, this is an easy troubleshooting technique so even if it doesn’t yield a solution, it didn’t take too much of your time.
  3. Restart your computer and networking equipment – In addition to your computer and all devices, don’t forget to restart networking equipment like your modem and Wi-Fi router.
  4. Change your DNS server – If you’re using the default servers assigned by your ISP, you can change things by using a free DNS server.
  5. Contact the network administrator or your internet service provider – Notifying the right people can make a difference especially if they’re unaware of the problem.
  6. Be patient – Go to another site, take a nap or work on your to-do list. When you come back, the problem may have fixed itself.
How to fix a 504 error

Other common server error codes

Whenever you see an error message beginning with “5” that means the server isn’t able to perform the request.

Chances are, if you’ve seen a 504 gateway timeout error, you may have also seen a 500, 502 or a 503 error message at some point. We give you insights and answers to handling these internet error codes.