9 Ways For Fixing The 504 Gateway Timeout Error


For WordPress web site house owners, skilled web site directors, and web site builders, there are many widespread WordPress errors to remember.

Fascinated about error codes could seem overwhelming and possibly even a contact pessimistic. Nonetheless, we discover that proactively cataloging why each occurs and the right way to repair them saves you a ton of time, cash, and mind cells on demystifying the clean or frozen display in entrance of you.

In spite of everything, how a lot simpler would life be if you got here with a message like Error ⒡00ⓓ: Hangry to decode why you’re so snarky over Slack at 3 PM on daily basis? (Responsible!)

Everybody who works with a WordPress web site — or has used the web for that matter — has most likely encountered the 504 Gateway Timeout error sooner or later.

So we put collectively this information to clarify what you’re taking a look at, why it occurs, a number of options for fixing it, and why it even issues that this error happens within the first place.

From fundamental checks, throughout superior troubleshooting strategies, come alongside as we wind by means of every little thing the savvy web site proprietor or supervisor ought to learn about fixing the 504 Gateway Timeout error.

How To Establish A 504 Gateway Timeout Error

On the world’s hottest browser, Google Chrome, you’ll usually see the acquainted “This website can’t be reached” message on a principally clean display, with the error code “HTTP ERROR 504” beneath it.

Nonetheless, there are a number of alternative ways this error will be referenced on Chrome, in addition to throughout completely different browsers, gadgets, working methods, server sorts, and packages.

"504 Gateway Time-out." error message dialog box with the title, "The server didn't respond in time."

So, should you see any of those messages, you’re seemingly coping with the identical 504 Gateway Timeout error we’re speaking about right now:

  • “Gateway Timeout Error”
  • “504 Gateway Time-out. The server didn’t reply in time.”
  • “Gateway Timeout (504)”
  • “Error 504”
  • “504 Error”
  • “HTTP Error 504”
  • “HTTP 504”
  • “HTTP Error 504. Gateway Timeout.”
  • “504 Gateway Timeout NGINX”
  • “NGINX 504 Gateway Timeout”

And typically, the error could also be rather less descriptive, forgoing the quantity code for a reference to timing as an alternative, equivalent to:

  • “This web page isn’t working. Area took too lengthy to reply.”
  • “The web page request was canceled as a result of it took too lengthy to finish”
  • “There was a difficulty serving your request, please strive once more in a couple of minutes”
  • “There was a gateway timeout. You need to go to your error log for extra info”

Web site house owners may even customise the web page that’s proven if a person encounters a 504 error whereas utilizing their web site, which suggests you may get a properly branded web page that makes use of some mixture of the codes and content material above.

Different occasions, you may simply end up gazing a clean display! As a result of the 504 error is fairly widespread, it’s not a nasty concept to imagine a clean web page is because of a server timeout scenario and apply the steps we’ll present later on this information to right it.

What The 504 Gateway Timeout Error Means

Technically, 504 Gateway Timeout is a server-side error from a server appearing as a gateway or proxy. It signifies that the server timed out whereas ready for a response from the subsequent server that it wanted to speak with, and thus didn’t full the motion it was requested to do.

What does that translate to in much less technical phrases? (In English, please.)

Right here’s the way it occurred. Let’s dive a bit deeper into the entire course of.

While you go to go to an internet site, the standard course of is that the server your browser is utilizing sends a request to the server internet hosting the web site you plan to go to. This request lets the receiving server (usually known as the “upstream server”) know to start out loading the web site you wish to see. Your server is the gateway on this occasion. Your server waits for the upstream server to reply and ship it information. If the upstream server doesn’t achieve this on time, as an alternative of your vacation spot web site you’re served a 504 Gateway Timeout error message as an alternative.

"Gateway" and "Upstream Server" diagram with a clock symbol in between the two to denote time taken.

Typically the error can resolve itself, however different occasions it might take going into completely different methods to implement a repair.

Now that you already know what you’re taking a look at, let’s determine why you’re seeing it.

What Causes The 504 Gateway Timeout?

The explanation a 504 error is so widespread is that server timing points can happen for a wide range of causes.

Listed below are lots of the hottest underlying troubles:

Server hiccups: Servers go down and decelerate on a regular basis for varied causes: elevated visitors, upkeep, {hardware} failure, and so forth. If any of the servers that it is advisable to work collectively to load an internet site are down, you’re seemingly going to see an error as a result of timing points.

Useful resource limitations: In case your web site is getting extra visitors, even when that visitors is from reputable sources, it might be greater than your present setup is able to deal with.

Different, extra normal interruptions: There’s much more than server uptime that may go mistaken when loading web sites. Routers can exit, gadgets can glitch, and so forth. Any of those can journey up the server-to-server connection and put you in 504 jail.

Proxy server issues: Proxy servers can add one other layer of safety, however typically they will throw off the steam of communication between the gateway and upstream servers.

Firewall confusion: Firewalls, particularly these with additional safety measures or customized configurations, may block sure connections by mistake, pondering they’re an assault. This will occur extra should you’re utilizing a firewall to limit sure web service suppliers (ISPs) or content material supply networks (CDNs).

DNS points: Typically, area identify system (DNS) servers can’t match the best area identify to the best IP deal with. This can be brought on by latest IP adjustments, previous DNS info being cached, or the DNS configuration being off.

DreamHost Glossary


The Area Title System (DNS) protocol retains information of which domains correspond to particular IP addresses. DNS allows you to browse the net by typing in common URLs as an alternative of IP addresses.

Learn Extra

Web site code errors: A mistake inside your web site code might make it in order that your server, or upstream servers down the road, can’t precisely discuss to one another, resulting in a timeout once they can’t resolve the miscommunication.

PHP employee limitations: In WordPress, PHP employees are processes that assist serve your web site content material to guests. In case you don’t have sufficient of those in place to maintain up with visitors, a server might should ‘get in line’ earlier than its request will be answered, which can seemingly trigger it to day trip.

DreamHost Glossary


PHP (Hypertext Preprocessor) is an open-source scripting language. It’s extensively utilized in net growth and will be embedded in HTML. A number of in style Content material Administration Methods (CMS), equivalent to WordPress, are constructed with PHP.

Learn Extra

Why Repair The 504 Gateway Timeout Error?

OK, now for one essential consideration earlier than we get into the work of fixing timeout errors: why trouble fixing the 504 error in any respect?

There are actually two core causes to care right here: person expertise and web optimization.

Any of the HTTP 500 errors cease an internet site from loading. That’s most likely the worst expertise you may create for a customer to your web site — particularly for first-time guests who have been referred to your web site or landed there from an advert, as it could possibly go away a nasty style of their mouth that retains them from ever returning. That’s an issue not simply on your ego and model however on your gross sales and retention.

Then, there’s search engine marketing (web optimization) to contemplate.

DreamHost Glossary

web optimization

Search Engine Optimization (web optimization) is the follow of bettering a website’s rating in search outcomes. Search outcomes are aggregated primarily based on quite a few elements, together with a website’s relevance and high quality. Optimizing your website for these elements can assist increase your rankings.

Learn Extra

If a search engine goes to index (principally, learn and categorize your web site so it is aware of what sort of searches to show it for) your web site and finds that loading is gradual or stopped as a result of a 504 Gateway Timeout error, it could possibly critically damage the way it chooses to rank your web site in search outcomes.

The additional down your web site seems on a search engine end result web page (SERP), the much less seemingly persons are to click on on it, and if search engine indexers encounter loading errors usually sufficient, they might cease indexing your web site in any respect. The end result? Eradicating you from search outcomes altogether.

In an age when clicks are forex, unresolved and repetitive 504 errors can critically set you again.

How To Repair The 504 Gateway Timeout Error (9 Potentialities)

Daunted? Don’t be. In case your web site is reporting a 504 Gateway Timeout error, right here’s what it is advisable to know to repair it.

1. Refresh The Web site

No, actually. It could possibly be that straightforward!

Within the case of connectivity interruptions, system snafus, visitors overload, and upkeep, it’s most likely only a matter of dangerous timing. Give it a minute and refresh your website to see if these points have been resolved and your website is again to being as accessible as ever.

Right here’s how:

  • Google Chrome on Mac: Hit Command + R
  • Google Chrome on Home windows: Use Ctrl + R
  • Safari (at present solely supported on Mac): Command + R
  • Microsoft Edge on Home windows: CTRL+R
  • Microsoft Edge on Mac: Command + Shift + R
"Keyboard Shortcuts To Refresh The Site" diagram with commands for Google Chrome, Safari, and Microsoft Edge.

2. Change/Restart Units And Browsers

{Hardware} bugs, outdated caches, and different fairly easy glitches can interrupt the server connection and trigger a timeout-related error.

Strive restarting and likewise altering up the gadgets and/or browsers you’re engaged on to see in case your website hundreds. You may additionally wish to reboot your modem or router. This will repair every little thing. Or, should you discover your website begins working in some locations however not in others, it might at the very least enable you to slender down what’s happening.

To restart most trendy desktop machines on MacOS, go to the Apple menu (prime left) > Restart. For a pc working Home windows, it ought to look one thing like navigating to Begin within the taskbar, choosing the ability icon, after which Restart on the subsequent display.

Whilst you can’t often bust open and repair any {hardware} that’s having an issue, you could possibly resolve why some browsers day trip whereas others are completely tremendous. That’s developing subsequent.

Get Content material Delivered Straight to Your Inbox

Subscribe to our weblog and obtain nice content material similar to this delivered straight to your inbox.

3. Clear Browser Cache

Browsers usually retailer web site info regionally (to your system) to avoid wasting loading time. When the information it has saved turn out to be outdated, they will result in connectivity points.

To clear the browser cache in Google Chrome, click on on the three vertical dots within the top-right nook to open the Chrome menu. Go to Extra Instruments > Clear Looking Knowledge.

Dialog box showing how to "Clear Browsing Data" by going into "More Tools"

Right here, you’ll be capable of choose what you wish to clear and over what time-frame. Simply make sure you hit the Clear information button to finish your mission. Consider this could look completely different relying in your system and working system.

"Clear browsing data" dialog box with the "Cookies and other site data" and "Cached images and files" boxes ticked.

For Safari, choose Safari within the prime left cowl, then > Clear Historical past > All Historical past > Clear Historical past button.

To clear the browser cache on Microsoft Edge, it’s as simple as placing “edge://settings/clearbrowserdata” within the deal with bar and choosing what you wish to clear and for what time vary.

Remember that these processes can look completely different relying in your system and which model of every working system you’re on.

4. Contemplate DNS Modifications And Cache

In case you or your internet hosting supplier has modified your web site’s DNS server as a result of adopting a brand new IP deal with or an entire new WordPress web site host, these adjustments can take time to go stay and for every little thing to work collectively flawlessly once more. It could take as many as 48 hours for the complete propagation to wrap up.

Nonetheless, if there haven’t been any adjustments you’re conscious of, or it’s been nicely previous the ready interval, it could possibly be one other caching concern, this time on the DNS degree.

Clearing your DNS cache will immediate the system you’re utilizing to request up to date info from the DNS server on web sites, so it is going to now not try to attach utilizing out-of-date DNS data.

Right here’s how:

Home windows:

  • Press Win + R and sort in ipconfig /flushdns
  • Hit Ctrl + Shift + Enter to run the command immediate
  • You need to see successful message when full


  • Be sure you’re working the latest working system
  • Open the Terminal and sort in sudo killall -HUP mDNSResponder (The working system you’re utilizing might influence the success of this command, so if this doesn’t appear to work you might want to go looking “flush DNS cache mac OS [your version here]”)
  • Hit Enter
  • Enter your admin password if prompted, then Enter once more to run the command.
    Notice: You seemingly gained’t see successful message after this. The command ought to simply run.

Google Chrome (Yep, it has its personal DNS cache!)

  • Enter “chrome://net-internals/#dns” into your Chrome deal with bar and hit Enter
  • Click on the Clear host cache button on the subsequent display

5. Disable The CDN

In case you haven’t solved it but, the problem could be your content material supply community. And you’ll find out if it’s the perpetrator by turning it off briefly and seeing if that helps.

In case you’re utilizing a CDN WordPress plugin and you’ll entry your plugins, merely deactivate it then check in case your website will load. (Entry this by way of WordPress Dashboard > Plugins.)

Nonetheless, should you can’t get to your WordPress admin as a result of 504 timeout error, you may entry your website by way of your host’s file supervisor or safe file switch protocol (SFTP). Right here’s the way it’s accomplished for DreamHost customers.

When you’re in your website’s listing, navigate to your web site’s identify then wp-content > plugins > your CDN plugin’s file. Rename that file (one thing like file name_OFF), save your adjustments, and refresh your web site to see if that has labored.

When this experiment is over, make sure you restore the unique identify of the folder and put it aside once more so the plugin can operate. You may additionally wish to go to the plugins part of your WordPress admin to verify it’s on and working.

Whereas this gained’t repair the problem, it is going to inform you in case your CDN is appearing up, from which level you may select to maneuver to a distinct supplier if it is sensible.

6. Examine WordPress Plugins

As a result of WordPress plugins are impartial little packets of code that combine together with your WordPress occasion, in the event that they go buggy they will interrupt the server connection and throw a 504.

To search out out if that is what’s happening, the method is similar to what we did above.

First, if you will get to your WordPress admin, go to the Plugins web page and deactivate every little thing. Then, reactivate every separately and refresh your website to see if it hundreds seamlessly. While you catch the perpetrator, you may deactivate it and search for a more recent model or different.

Plugins tab selected with the option to "Deactivate" annotated and applied to all items in the list below.

In case you can’t entry the dashboard, you’ll should open it up by way of your host file supervisor or an SFTP platform.

Within the listing, navigate to your web site identify > wp-content > plugins. Now rename that entire file (like plugins_OFF) save, and reload. If it really works, you already know the rub is in your plugins someplace. Now it is best to be capable of log into your WP admin, navigate to your plugins, and switch them again on one after the other to see which journeys up your web site load time.

7. Flip Off Your Firewall

Mac and Windows firewall symbols with a sliding button turned to "OFF."

To briefly flip off your firewall to see if its settings are what’s inflicting the 504 error, comply with these steps:

Home windows:

  • Begin menu > Settings > Privateness & safety > Home windows Safety > Firewall & community safety
  • Select your community profile
  • Discover Microsoft Defender Firewall and change off


  • Apple menu > System Preferences > Safety & Privateness > Firewall (on the prime of the field)
  • Choose the button to show the firewall on
  • You will have to unlock this web page utilizing your password to make any adjustments

(Notice: We suggest turning your firewall again on! If it’s inflicting gateway errors, as soon as it’s again on you may take a while digging into its configurations to enhance efficiency.)

8. Change Internet Server Settings

For the extra technically superior, altering the settings on Apache and NGINX might enable you to cut back and even get rid of 504 errors.

Right here’s how:


  • Discover your Apache configuration file (httpd.conf or apache2.conf)
  • Open it in a textual content editor
  • Modify Timeout by growing the default to 60 seconds. So in order for you it to be 500 seconds, for instance, use Timeout 500
  • Save and exit the editor
  • Now, open and edit the php.ini file by growing max_execution_time from the default 30 seconds to one thing like 400 seconds utilizing max_execution_time = 400
  • Save and restart Apache to place your timing will increase into impact utilizing sudo service apache2 restart


  • Find the NGINX configuration file (usually /and so forth/nginx/nginx.conf)
  • For NGINX + FastCGI Course of Supervisor or when utilizing NGINX as a reverse proxy for Apache, listed here are all of the locations the place you’re going to extend the default values (we’ll use 500 and 400 seconds once more):
    • proxy_connect_timeout 500;
    • proxy_send_timeout 500;
    • proxy_read_timeout 500;
    • send_timeout 500;
    • fastcgi_read_timeout 400;
  • Reload the NGINX server: sudo service nginx reload
  • Edit the PHP-FPM pool config file (/and so forth/php/[version]/fpm/pool.d/www.conf — put your individual model instead of [version])
  • Set: request_terminate_timeout = 400
  • Within the php.ini file, set: max_execution_time = 400
  • Reload PHP-FPM and NGINX utilizing sudo service php[version]-fpm reload && sudo service nginx reload

Hopefully, that needs to be the tip of these delicate timeout server settings!

9. Flip To Your Host For Help

In case you’re throwing your fingers up within the air and don’t know what else to do anymore, it is best to all the time be capable of contact your WordPress web site host for fast and dependable assist.

Apart from troubleshooting and fixing issues alongside you, they will additionally rapidly do just a few issues that are likely to wipe out 504 errors, equivalent to enhance PHP employees, or improve you to a server with extra or higher sources to deal with points associated to visitors.

What’s that we hear? In case you’re not working with a internet hosting firm that’s pleased to do something they will to verify your web site is performing nicely for each searchers and serps, it’s time to buy round for a brand new one.

At DreamHost, we’re not simply into serving to web site house owners, managers, and builders with widespread errors — we’re fanatical in regards to the WordPress platform as an entire!

That’s why we provide DreamPress, a package deal we particularly constructed for shoppers who desire a hassle-free but up-to-date and high-performing WordPress web site.

And, for a completely white-glove expertise, our professional providers division can take web site growth and administration off your fingers.

Whether or not you wish to get within the weeds with us or simply rake in the advantages of a profitable WordPress web site with out getting your fingers soiled, DreamHost can create the proper internet hosting and assist plan for you.

Schedule a free session with our professional providers group and start crafting your web site’s future right now!

Get Content material Delivered Straight to Your Inbox

Subscribe to our weblog and obtain nice content material similar to this delivered straight to your inbox.