How to Fix HTTP Error 504 (Gateway Timeout)
HTTP Error 504 – “Gateway Timeout” – means a gateway server waited for another server behind it and got no reply in time, so it gave up. The page didn’t load because something was too slow, not because it refused. It usually points to a slow script, server load, or a timeout set too low. Here is how to fix it.
What the error means
Like a 502, a 504 happens behind the gateway – but the problem is time, not a bad answer. The gateway asked the server for the page, waited, and the reply never came within the limit. The usual culprit is a slow process: a heavy query, a long task, or a server under strain.
If you are just visiting
Reload the page and try again shortly – a 504 is often a passing slowdown. Clearing your browser cache and flushing your DNS can help too. If it continues for everyone, it is on the website.
If the website is yours
- Find the slow part. If one page times out while others load, a slow query or long-running script is the cause – check the error log.
- Raise the time and memory limits for genuinely long tasks – see PHP settings and limits in cPanel.
- Rule out overload and plugins. A traffic spike or a heavy plugin slows every response; pause a suspect and watch.
- Check external calls. A slow third-party API the page waits on can trigger a 504 even when your server is fine.
On JetHost hosting
If a 504 keeps showing on a site you host with us, open a ticket and we’ll check resources and the slow request. Repeated timeouts under load usually mean the site needs a bigger plan or some optimisation. Related: HTTP 502 and the browser-side ERR_CONNECTION_TIMED_OUT.
JetHost Experts Tip
Raising the timeout hides a slow page; it rarely fixes it. If one request always times out, find the slow query or plugin behind it – that solves the 504 for good.
Frequently asked questions
A 504 is no reply in time (too slow); a 502 is an invalid reply. Both happen behind the gateway, but one is slowness and the other is a broken response.
Rarely. A 504 comes from the server side being slow. If other sites load fine, the slow one is the issue.
A busy server answers slower, so requests cross the timeout. That is a sign to optimise the site or move to a bigger plan.
New Hosting Plan with 80% OFF
Upgrade your website’s home without the heavy bill. Get new hosting plan with a huge 80% discount. Get free SSL, email accounts, and a control panel to manage your site. Enjoy fast performance, secure environment, and 24/7 support – all in one affordable package.
Need more help?
Still hitting a 504 on a site you host with us? Open a ticket through Client Area → Support Tickets with the page that times out, and we’ll find the slow part.


