When you run into trouble accessing certain websites, your browser often displays an HTTP status code that helps you decipher the problem. These codes come in different types and variations, each with its individual meaning and solutions. There’s a 90% chance that you’ve encountered a 504 Gateway Timeout error at least once while surfing the internet.
What does 504 Gateway Timeout mean? The 504 Gateway Timeout error is labeled differently by several websites and browsers but the variations mean the same thing. So if a particular website throws a “Gateway Timeout (504)” error while others display theirs as “HTTP Error 504,” “Domain took too long to respond,” or “Gateway Timeout,” they’re pointing out the same issue.
In this guide, we’ll walk you through everything you need to know about the 504 Gateway Timeout error—meaning, causes, and the solutions.
What Does the 504 Gateway Timeout Error Mean?
There’s a lot that happens behind the scene when you visit a website or click a link on your browser. Typically, it follows the steps below:
- Enter a URL in the browser’s address bar.
- The browser validates and locates the website’s IP address (via DNS lookup ).
- The browser sends a request to the website’s servers.
- The servers process the request and send a copy of the web page to the browser.
- The browser assembles and interprets the information from the server and displays a webpage.
If your browser displays the 504 Gateway Timeout error instead of a functional webpage, that tells you there was a problem with Step 4. That is, the website’s servers failed to process your browser’s request fast enough.
This occurs when a website’s gateway server (or primary server) doesn’t receive a timely response from a secondary server (also called an upstream server). So, what exactly causes this delay in server connection? Proceed to the next section to find out.
What Causes the 504 Gateway Timeout Error?
Oftentimes, the 504 Gateway Timeout error arises due to server connectivity issues on the website’s end; perhaps, one (or all) of the servers crashed or is temporarily overloaded and can’t process new requests. This error may also occur if the website recently moved to a new IP address (hosting service) or its firewall configuration is erroneously blocking safe content.
Server-side malfunctions are commonly responsible for the 504 Gateway Timeout error, so a website’s administrator is in the best position to resolve the problem. Nonetheless, you should also troubleshoot your device. This is because the 504 Timeout error could also stem from issues with your device or network settings—although the possibility is quite rare.
How to Fix the 504 Gateway Timeout Error
We’ve compiled a handful of potential troubleshooting methods that’ll resolve the error if the problem is from your end. Put them to test and see if they work for you.
1. Refresh the Webpage
As earlier mentioned, a website may display the 504 error code if its servers are overloaded—perhaps due to a sudden spike in traffic. If this is the cause of the error, reloading the webpage may restore things back to normalcy. Click the circular arrow icon next to the address bar or press F5 to reload the page.
You can also reload a page on any browser using the Control + R shortcut (for Windows) or Command + R (for Mac).
2. Restart Your Router or Network Device
Before you reboot your network device, connect your computer to an alternate network if there’s any available. If you can access the webpage on a different network, your wireless router or internet modem is the problem.
Restart the network device, reconnect your computer to the network, and reload the webpage. If you’re still getting the 504 Gateway Timeout error, consider resetting the router or modem to factory default.
3. Check Your Proxy Settings
If you use a proxy on your computer, make sure the server settings are correct and properly configured. Go to Settings > Network & Internet > Proxy (for Windows) or System Preferences > Network > Advanced > Proxies (for macOS) to check for any manual proxy setup.
Disable the proxy and refresh the affected website. If your browser loads the webpage, your proxy configuration is probably the problem.
4. Change DNS Servers
Most computers use the default Domain Name Servers (DNS) designated by the Internet Service Provider (ISP). These ISP-assigned servers are sometimes unreliable and cause issues like slow connectivity. If the affected webpage loads successfully on a different device, change your PC’s DNS provider to any free and reliable public server with fast response time. That can make a lot of difference.
Change DNS on Windows
To change your DNS provider on Windows , go to Settings > Network & Internet > Status and click Change adapter options.
2. On the next window, double-click on the adapter responsible for your network connection: Ethernet or Wi-Fi.
3. Click the Properties button.
4. In the “This connection uses the following items” section, double-click Internet Protocol Version 4 (TCP/IPv4).
5. Check the “Use the following DNS server addresses,” enter 22.214.171.124 in the Preferred DNS server box and 126.96.36.199 in the Alternate DNS server box. Click OK to proceed.
6. Finally, click OK on the Wi-Fi/Ethernet Properties window to save the changes.
Change DNS on macOS
For Mac users, navigate to System Preferences > Network and click the Advanced button at the bottom-left corner.
Go to the DNS tab and click the plus (+) icon at the button-left corner to add a new DNS server.
Add these Google Public DNS: 188.8.131.52 and 184.108.40.206. Click OK to proceed and click Apply on the next page to save the changes.
5. Clear the DNS Cache
When you visit a website, your computer stores information about the website’s domain name in a DNS cache. Next time you visit the website, data in the DNS cache swiftly points your browser in the right direction so that the website loads faster.
It’s possible to experience a timeout error if a website changes its IP address or server. This is because the DNS cache will direct your browser to the old (or outdated) IP address. You can fix this problem by clearing the DNS cache . That will prompt your device and browser to obtain updated DNS information next time you visit the website.
To clear the DNS cache on Mac, launch Terminal (go to Applications > Utilities > Terminal), paste the command below in the console, and press Return.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Enter your Mac’s password when prompted and press Return.
For Windows devices, launch the Command prompt (press Windows + X and select Command Prompt (Admin)), paste the command below in the console, and press Enter.
Enjoy an Error-Free Internet Experience
Hopefully, you now know what causes the 504 timeout error and how you can attempt to fix it as a website visitor. If the error continues after troubleshooting your computer and network settings, reach out to the website administrator; the problem is most definitely due to server-side malfunctions. If the error is popping up on every other website, you should contact your ISP to confirm if there’s a network outage.