What to do about a 504 gateway timeout error message

Camryn Smith

May 20, 2024 — 3 min read

504 vs 502 computer errors are confusing, so we help you understand what's happening when your web page won't load.

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” whenever you request a specific URL. Sometimes, the communication between the gateway server and the main server breaks down.

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

502 vs 504 error

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
  • 504 bad gateway
  • HTTP error 504
  • gateway timeout
  • error code 504
  • 504 gateway timeout
  • This page isn’t working – Domain took too long to respond
  • 504 gateway timeout – the server didn’t respond in time
  • NGINX 504 gateway timeout
  • Site owners: There was a gateway timeout. You should visit your error log for more information
  • A blank, white screen

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.

504 error message FAQs

Is a 504 gateway error my fault?

No, this type of error is not your fault, it’s a breakdown of communication between the gateway and main servers.

A first action should be to refresh your page. If that doesn’t work, try turning off your VPN and/or resetting your modem or gateway device. You can also clear your cache.

A 504 server error will usually display an error code, but you may get a white screen. Don’t panic, just refresh the page, close your browser and relaunch it or try the other steps mentioned in this article. 

Camryn Smith

Written by:

Camryn Smith

Camryn Smith started writing for Allconnect in July 2022 and has developed broadband expertise across the landscape, including home internet providers, plans, pricing and equipment, as well as internet technolog… Read more

Robin Layton

Edited by:

Robin Layton

Editor, Broadband Content

Read bio