How to Solve the 504 Gateway Timeout Error in WordPress Quickly

How to Solve the 504 Gateway Timeout Error in WordPress Quickly

Among the most frequent HTTP 5xx errors that website owners and visitors encounter is the 504 Gateway Timeout error. Understanding how to repair server errors like this is critical for many WordPress websites and eccomerce sites in order to keep their visitors.

What Does a 504 Gateway Timeout Error Mean?

When you visit a website in your browser, your browser sends a request to the web server that hosts the site. The server responds with the requested resources after processing the request.

One of several HTTP status codes is used in the server response to show the status of the response to the browser. Not all HTTP status codes, however, are failures. A 200 OK status code, for example, indicates that the server successfully processed the request and that “Everything is OK”.

The HTTP status code 5xx indicates that something is wrong with the server, that the server is aware of the problem, and that it is unable to satisfy the client’s request. They’re also known as Server Error 5xx status codes as a result of this.

There are a few different types of 504 error messages that you might encounter:

  • 504 Gateway Timeout
  • 504 Gateway Timeout NGINX
  • NGINX 504 Gateway Timeout
  • Gateway Timeout Error
  • Gateway Timeout (504)
  • Error 504
  • 504 Error
  • HTTP Error 504
  • HTTP Error 504 — Gateway Timeout
  • HTTP 504
  • This page isn’t working — Domain took too long to respond
  • 504 Gateway Time-out — The server didn’t respond in time
  • A blank white screen

Despite their differences in terminology, all of the above error responses point to the same 504 Gateway Timeout server error.

How to Fix the 504 Gateway Timeout Error

Try Reloading the Webpage

When you get a 504 Gateway Timeout error, one of the first things you can do is wait a few minutes and then try reloading the tab.

In most browsers, pressing the F5 keyboard shortcut will refresh/reload the webpage. You can use the CTRL+F5 shortcut combination to clear the page’s browser cache before reloading.

Reboot Your Network Devices

A 504 Gateway Timeout error can be triggered by issues with your network equipment, such as your modem or router. Rebooting these devices can assist you in resolving the issue.

Check Your Proxy Settings

Between your computer and the internet is a proxy server. It’s mostly used to improve online privacy by trying to hide personal information (such as computer location) from websites and webservers (e.g. using a VPN).

Though proxy servers are rarely the cause of a 504 error, incorrect proxy server settings may sometimes be the cause. You might try disabling the proxy server and reloading the page to see if that fixes the problem.

DNS Issues

The FQDN (fully qualified domain name) not resolving to the correct IP address, or the DNS server not responding, is the most likely cause of a server-side DNS problem. This usually happens after you’ve moved your WordPress site to a new server or host. As a result, it’s important to wait for the DNS records for the domain to spread fully, which can take up to 24 hours.

You might try flushing your local DNS cache to resolve client-side DNS issues. It’s similar to clearing the cache in your browser, except you’re flushing the DNS cache from the operating system.

If you’re using Windows, you can clear the DNS cache by typing the following command into the Command Prompt:

ipconfig /flushdns

If it succeeded, you should see a message that says, “Successfully flushed the DNS resolver Cache”.

Finally, you can temporarily change your client-side DNS servers. Your ISP applies DNS servers to you automatically by default. However, you can temporarily change these to public DNS IPs.

Google Public DNS, Cloudflare 1.1.1.1, Quad9 DNS, and Cisco OpenDNS are some of the more stable options.

Disable Your Site’s CDN Temporarily

It’s also possible that the problem is with your content delivery network (CDN). Many CDNs will attempt to service the entire website from their cache if the site’s origin server is unavailable.

The majority of CDNs, however, do not allow this function by default.

CDNs that offer complete proxy services, such as Cloudflare or Sucuri, have additional firewalls between their edge servers and your origin node. As a result, you can experience more HTTP 5xx errors while using them. Since most of them cache 5xx errors returned by your origin server, troubleshooting them is easy.

504 Gateway Timeout at Cloudflare (Option 01)

When your site’s origin server responds with a regular HTTP 504 response, Cloudflare will display a custom 504 Gateway Timeout error screen.

The problem is with your web server, not with Cloudflare. You may either pursue the other options or seek technical assistance from your hosting provider’s support.

504 Gateway Timeout at Cloudflare (Option 02)

The error screen will list “cloudflare,” which is currently the standard server name for all Cloudflare properties, if Cloudflare is the source of the 504 Gateway Timeout error. Typically, the error screen would look like this:

Cloudflare is most likely already aware of the problem and working on a solution. You can double-check this by going to the Cloudflare System Status page.

504 Gateway Timeout at Cloudflare Due to Large Uploads

Server timeouts can also be caused by the scale of your website’s uploads. On both the Free and Pro plans, Cloudflare restricts the upload file size (per HTTP POST request) to 100 MB.

Server Issues (Check With Your Host)

One of the most common causes of a 504 Gateway Timeout error is server problems. Since the majority of WordPress pages are hosted on Nginx or Apache webservers, this indicates that Nginx or Apache is waiting for an answer from it and has timed out.

Spam, Bots, or DDoS Attacks

By submitting too many requests or resource-intensive requests, malicious attackers may bring your web server to a halt. If your site is being spammed by bots or is being targeted by a DDoS attack, your server may become overwhelmed, resulting in 504 Gateway Timeout errors for many legitimate users.

Leave a Reply