The Quick & Easy Guide to Fixing 504 Gateway Timeout Errors

If you’ve ever visited a website that served you an error page, you know how frustrating it is.

One of the worst things you can do as a brand is not meet your audience’s needs and expectations. If your website visitors see an error page when they’re looking for help or information, they could get frustrated and lose trust in your brand, permanently damaging your reputation.

The 504 Gateway Timeout Error is one type of error that can hurt the user experience in this way. To help you avoid losing brand sentiment and consumer trust, we’ve fleshed out exactly what this error means and what its most common causes and solutions are.

Improve your website with effective technical SEO. Start by conducting this  audit. 

Here’s how a 504 Gateway Timeout Error might appear in your user’s browser:

pasted image 0-19Image Source

504 Errors Wording

The screenshot above depicts how a 504 Gateway Timeout Error appears in one server. Below are some other common ways a 504 error might appear, depending on the server, operating system, or browser you’re using.

  • In Google Chrome, a 504 error will appear as HTTP ERROR 504. This code will appear below a message that reads something like: “This site can’t be reached. _____ took too long to respond.”

504 Gateway Timeout Error wording  in Google Chrome

Image Source

  • In Windows-based programs, a 504 error will appear as ERROR 504, HTTP_STATUS_GATEWAY_TIMEOUT, or “The request was timed out waiting for a gateway message.” Here’s how it may appear when using Excel:

504 Gateway Timeout Error wording in Microsoft Excel

Image Source

  • During a Windows Update, a Gateway Timeout Error generates a 0x80244023 error code. The message will be: WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT.

504 Gateway Timeout Error wording in Windows Update

Image Source

  • In other operating systems, web servers, or browsers, a 504 error may also result in the following message — although it’s less common: “The proxy server did not receive a timely response from the upstream server.” Here’s a slight variation:

504 Gateway Timeout Error wording in Internet Explorer

Image Source

So now we know how the 504 error is worded — but what does it mean exactly? Let’s decode it below.

What does 504 gateway timeout mean?

When visiting a website, your server sends a request to another server where that site is hosted. This server — known as the “upstream server” — receives the request and responds with whatever resources are needed to load the website on your browser.

However, a 504 Gateway Timeout error means that your server didn’t receive a quick enough response from the upstream server. Because its request timed out, your server is unable to load the web page and, ultimately, fulfill its role as a gateway — hence the name “Gateway Timeout” error.

You might be wondering what exactly causes the delay in the upstream server’s response — and that’s a good question. Let’s address it below.

504 Gateway Timeout Causes

504 Gateway Timeout Errors are among the most frustrating HTTP status codes you can receive. They indicate what happened to your website, but they don’t tell you why it happened, making it challenging for you to pinpoint its cause and ultimately correct the issue.

Below are a few possibilities.

Server Connectivity Issues

Most websites live on multiple servers or third-party hosting providers. If your server is down for maintenance or any other reason, your website could serve visitors a 504 Gateway Timeout Error page.

DNS Changes

If you’ve recently changed servers or moved your website to a different IP address, it’ll make changes to your website’s DNS server. This could cause your website to serve its visitors a 504 Gateway Timeout Error page. Your website won’t be up and running until these DNS changes take full effect, which can take a few hours.

Faulty Firewall Configurations

Your firewall is your website’s gatekeeper, protecting your site from malicious visitors or distributed denial-of-service (DDoS) attacks. Sometimes, a faulty firewall configuration will cause your firewall to deem requests from a content delivery network as an attack on your server and reject them, resulting in a 504 Gateway Timeout Error.

Errors in Your Website’s Code

If there’s a mistake in your website’s code, your server might not be able to correctly answer requests from a content delivery network.

Network Connectivity Errors

Since a 504 error is the result of a timeout during the processing of a request between servers, the problem likely lies with them — not the user’s internet connection or device. However, if only one user reports seeing a 504 error on your site, it could have to do with their modem, router, or another device. or their internet connection.

Since there are multiple reasons why a 504 error might occur, it will ultimately be up to you to rule each one out until you find the true cause. Fortunately, there are five common and effective solutions for fixing most 504 Gateway Timeout Errors’ causes.

1. Look for server connectivity issues.

If your server is down for maintenance or any other reason, then your website will likely serve visitors a 504 Gateway Timeout Error page. The only way to troubleshoot this issue is to wait for your server to finish maintenance or fix the problem causing the error.

2. Check for any DNS changes.

If you’ve recently changed hosting providers or moved your website to a different IP address, then your website’s DNS server will need to be updated. These DNS changes take a few hours to process so in the meantime your website might serve visitors a 504 Gateway Timeout Error page. The only solution is to sit tight while these DNS changes take effect.

3. Sift through your logs.

If the problem is not your server’s connection or DNS information, then check out your server logs. These logs provide details about your server’s health and status. Sifting through them may uncover other issues that could be causing a 504 error.

4. Fix faulty firewall configurations.

A faulty firewall configuration may be the reason behind your 504 Gateway Timeout Error. To rule it out as the cause, you can temporarily deactivate your firewall.

If your device runs on Windows, then navigate to your control panel and click Update & Security > Windows Security > Virus & Threat Protection > Manage Settings. On this settings page, you can deactivate your firewall.

If your device runs on Mac OS, then simply navigate to System Preferences > Security & Privacy > Firewall to deactivate it.

Turning off firewall in Mac OS can help resolve 504 Gateway Timeout error

Once you’ve deactivated your firewall, check to see if the 504 error is resolved. If it is, you can either reconfigure the settings of your existing antivirus program or switch to a new one.

If the error is not resolved, don’t forget to reactivate your firewall before moving onto the next step.

5. Comb through your website’s code to find bugs.

Comb through your code to find any bugs or copy your code into a development machine. It’ll perform a thorough debug process that will simulate the situation in which your 504 Gateway Timeout Error occurred and allow you to see the exact moment where things went wrong.

6. Contact your hosting provider.

Contacting your hosting provider should be a last resort. But if you’ve tried the steps above and are still seeing the 504 Gateway Timeout error, they may be able to solve the issue or provide valuable insight.

How 504 Gateway Timeout Errors Affect SEO

Fixing a 504 Gateway Timeout Error can take time — but it’s well worth the effort considering how it can impact your site’s technical SEO.

Like an HTTP 500 Internal Server Error, 503 error, or any other 5xx error, a 504 Gateway Timeout error prevents your website from loading. This not only hurts the user experience — it also hurts your SEO performance.

If a web crawler attempts to crawl one of your pages and is served a 504 error, then it can’t crawl the page. If that page has already been indexed, then it might be lowered in the search engine results. Or it might be deindexed if the error persists.

Resolving the 504 Gateway Timeout Error

There’s no foolproof way to prevent 504 Gateway Timeout Errors on your site, but there are steps you can take to resolve them. By fixing this error as quickly as possible, you’ll ensure that visitors continue to have seamless experiences on your site and mitigate any negative impacts on your SEO.

Editor’s note: This post was originally published in January 2019 and has been updated for comprehensiveness.

Improve your website with effective technical SEO. Start by conducting this  audit.