“504 Gateway Time-out”
Your front server (nginx, Apache, Cloudflare or a load balancer) passed the visit to the server or app that builds the page and gave up waiting for an answer. The app may still be working on the request; it just took longer than the front server allows (often 30 or 60 seconds). Visitors see a plain "504 Gateway Time-out" page instead of your site.
Is your site showing it right now?
The free scan loads your page like a visitor and checks for this message, plus broken links, script errors and phone layout. It also walks your signup, booking or contact form, without sending anything.
Free, no signup. Usually done in about a minute.Why it happens
- A slow database query or a huge uncached page takes longer to build than the time limit
- The page waits on a third-party API (payments, maps, a feed, a mail service) that's slow or down
- The server is overloaded, so every request queues behind the others
- A plugin, cron job or import is running inside page requests and blocking them
- The front server's timeout is set too low for a page that legitimately takes a while (a big report or export)
How to fix it
Find out which pages time out
Load the homepage, a product or post page and the admin. If only one kind of page fails, the problem is in what that page does (a query, an API call). If everything fails, the server is overloaded or the app is stuck.
Read the slow log
Enable your database's slow query log and PHP-FPM's slow log (or your app framework's request timing). The slowest entries name the plugin, query or external call to blame.
Cut the slow work out of the page
Cache the page or the query, move API calls and imports to a background job, and set a short timeout on outbound calls so one slow service can't hang the page. On WordPress, disable plugins one at a time to find the one doing it.
Restart and check resources
Restart the app or PHP-FPM, then watch CPU and memory. A server at 100% CPU times out everything; the fix is to lighten the load or move to a bigger server.
Raise the timeout only if the page really needs it
For a page that must run long (an export, a large report), raise the proxy's timeout for that path alone (nginx: proxy_read_timeout; Cloudflare has a fixed 100 s limit on most plans). Don't raise it site-wide to hide a slow page.
Questions
Is a 504 the same as a 502?
No. A 502 means the app answered with something invalid or wasn't running at all. A 504 means the app didn't answer in time: it's slowness, not a crash, though the two often appear together under load.
Does Cloudflare cause 504s?
Cloudflare reports them. Its servers wait about 100 seconds for your origin; if your origin takes longer, Cloudflare shows the 504 and names itself. The slow part is still your server or app.
Does it hurt search rankings?
A short spell doesn't. Repeated timeouts make search engines crawl you less, and the slow pages behind the 504s hurt rankings on their own, so fixing the cause helps twice.
Can Page Canary tell me if this comes back?
Yes. Page Canary checks your key pages every day for this message and others like it, confirms it on a second check, and emails you with the fix. One site is free.