Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTP 504 Gateway Timeout means a gateway or proxy did not receive a timely response from an upstream server. Your browser reached an intermediary—such as a reverse proxy, load balancer, or CDN—but that intermediary gave up waiting for the server behind it. The code identifies a timeout relationship, not the exact component that failed.

For visitors, retrying and reporting precise details is usually the right response. For site operators, the investigation starts by identifying which layer generated the 504, then checking origin capacity, application and database latency, network reachability, and recent changes.

What a 504 Gateway Timeout means

RFC 9110 defines 504 as the response returned when a server acting as a gateway or proxy “did not receive a timely response from an upstream server it needed to access in order to complete the request.” In a typical request, the path looks like:

Browser → CDN or reverse proxy → load balancer → web application → database or external service

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
  • DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
  • AX1800: Enjoy smoother and more stable streaming, gaming, downloading with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Performance varies by conditions, distance to devices, and obstacles such as walls.
  • CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
  • EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
  • OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.

Any intermediary in that chain can have a deadline. If it forwards your request but the next server does not answer before that deadline, the intermediary may return 504. “Timely” is configuration-dependent: HTTP does not prescribe one universal number of seconds. A CDN, proxy, web server, hosting platform, and application can all use different limits.

What the code does not tell you

  • It does not prove that your internet connection is broken.
  • It does not identify whether the origin application, database, dependency, network path, or proxy is responsible.
  • It does not mean every request to the site is failing; one slow URL, region, data center, or request type may be affected.

The response can be generated by the origin or by a CDN/proxy in front of it. Those cases look similar in a browser but require different logs and fixes.

Is a 504 your internet or the website?

Most 504s require server-side investigation because the message comes from a gateway that is waiting on another server. A local VPN, corporate proxy, firewall, or unusual DNS path can still contribute, particularly if only your network receives the error. Test from a second connection if possible. If the site fails for multiple people or networks, the operator and hosting path are the likely focus.

What visitors should do

  1. Wait briefly and reload once. A temporary overload or stalled request may clear.
  2. Open the URL without a VPN or unusual proxy, if doing so is safe and permitted.
  3. Try another network or device to distinguish a local path problem from a site-wide failure.
  4. Capture the exact URL, time and time zone, visible error code, screenshot, and any request ID or Cloudflare Ray ID.
  5. Send those details to the site owner. Include whether other pages or services worked.

Repeated refreshes can increase load on an already struggling origin, so do not run an aggressive retry loop.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
TP-Link AC1200 WiFi Router Dual Band Wireless Internet Router (Archer A54)
  • Dual-band Wi-Fi with 5 GHz speeds up to 867 Mbps and 2.4 GHz speeds up to 300 Mbps, delivering 1200 Mbps of total bandwidth¹. Dual-band routers do not support 6 GHz. Performance varies by conditions, distance to devices, and obstacles such as walls.
  • Covers up to 1,000 sq. ft. with four external antennas for stable wireless connections and optimal coverage.
  • Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
  • Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
  • Advanced Security with WPA3 - The latest Wi-Fi security protocol, WPA3, brings new capabilities to improve cybersecurity in personal networks

504 versus 502 Bad Gateway

Both codes involve a gateway or proxy, but they describe different upstream outcomes.

Status What the intermediary received First investigation
502 Bad Gateway An invalid or otherwise unacceptable response from an inbound server Inspect protocol validity, malformed headers, connection resets, and upstream response handling
504 Gateway Timeout No response within the intermediary’s configured time window Inspect upstream health, latency, reachability, saturation, and timeout alignment

A 502 can happen quickly when a backend sends a broken response. A 504 usually means the gateway waited and then stopped waiting. Either code can be produced at the origin or by a fronting service, so the response body alone is not enough to locate the fault.

Common causes of a 504

Origin overload or resource saturation

CPU exhaustion, memory pressure, thread or worker limits, connection-pool exhaustion, or a full queue can leave requests waiting until the proxy deadline. Check host metrics and application concurrency at the incident time, not only current utilization.

Slow application work

Unindexed database queries, large reports, synchronous file processing, lock contention, or unexpectedly large responses can exceed the gateway window. Trace the request through application logs and measure time spent in each dependency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
NETGEAR Nighthawk WiFi 6 Router R6700AX, Up to 1,500 sq ft, 1.8 Gbps
  • NIGHTHAWK WIFI 6 ROUTER FOR YOUR WHOLE HOME: Delivers fast, reliable WiFi across every room of your apartment or small home for streaming, gaming, video calls, and smart home devices, all running at the same time without slowing each other down.
  • WORKS WITH YOUR EXISTING INTERNET SERVICE: Pairs with your existing modem or gateway via ethernet. Compatible with most cable, fiber, DSL, and satellite providers. Some gateways and modem router combos may require bridge mode. No coax needed.
  • SET UP AND MANAGE YOUR NETWORK WITH THE NIGHTHAWK APP: Download the free Nighthawk app on iOS or Android for guided setup. Manage WiFi, run speed tests, pause devices, and set up guest networks from anywhere. Active internet required.
  • READY FOR THE DEVICES YOU ALREADY OWN: Your phones, laptops, and TVs work right out of the box. WiFi 6 delivers speeds up to 1.8 Gbps across 2.4 GHz and 5 GHz bands. Backward compatible with WiFi 5 and earlier.
  • COVERAGE IN EVERY ROOM: Covers up to 1,500 sq. ft. for up to 20 connected devices. Walls, floors, and interference can reduce range. Larger or multi-story homes may benefit from a NETGEAR Orbi mesh WiFi system.

Dependency failure or slowness

An application may be healthy but waiting on a payment API, identity provider, object store, database, or internal service. A blocked dependency can make the public endpoint appear to be a proxy problem.

Crashes and failed restarts

If the origin process has crashed, is repeatedly restarting, or is accepting connections without completing requests, the proxy may report 504. Correlate process, container, platform, and deployment events with the first error timestamp.

Network reachability problems

The proxy may be unable to reach the origin because of routing, firewall rules, security groups, DNS changes, or a regional network failure. “The server is up” is not sufficient; test reachability from the relevant proxy or CDN path.

Blocked or mismatched timeouts

A firewall or service may silently drop a connection, while mismatched gateway, load-balancer, application, and database limits produce premature failures. Increasing a timeout can hide symptoms and tie up more workers, so understand the slow operation first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
TP-Link Dual-Band BE3600 Wi-Fi 7 Router, Archer BE230
  • 𝐅𝐮𝐭𝐮𝐫𝐞-𝐏𝐫𝐨𝐨𝐟 𝐘𝐨𝐮𝐫 𝐇𝐨𝐦𝐞 𝐖𝐢𝐭𝐡 𝐖𝐢-𝐅𝐢 𝟕: Powered by Wi-Fi 7 technology, enjoy faster speeds with Multi-Link Operation, increased reliability with Multi-RUs, and more data capacity with 4K-QAM, delivering enhanced performance for all your devices.
  • 𝐁𝐄𝟑𝟔𝟎𝟎 𝐃𝐮𝐚𝐥-𝐁𝐚𝐧𝐝 𝐖𝐢-𝐅𝐢 𝟕 𝐑𝐨𝐮𝐭𝐞𝐫: Delivers up to 2882 Mbps (5 GHz), and 688 Mbps (2.4 GHz) speeds for 4K/8K streaming, AR/VR gaming & more. Dual-band routers do not support 6 GHz. Performance varies by conditions, distance, and obstacles like walls.
  • 𝐔𝐧𝐥𝐞𝐚𝐬𝐡 𝐌𝐮𝐥𝐭𝐢-𝐆𝐢𝐠 𝐒𝐩𝐞𝐞𝐝𝐬 𝐰𝐢𝐭𝐡 𝐃𝐮𝐚𝐥 𝟐.𝟓 𝐆𝐛𝐩𝐬 𝐏𝐨𝐫𝐭𝐬 𝐚𝐧𝐝 𝟑×𝟏𝐆𝐛𝐩𝐬 𝐋𝐀𝐍 𝐏𝐨𝐫𝐭𝐬: Maximize Gigabitplus internet with one 2.5G WAN/LAN port, one 2.5 Gbps LAN port, plus three additional 1 Gbps LAN ports. Break the 1G barrier for seamless, high-speed connectivity from the internet to multiple LAN devices for enhanced performance.
  • 𝐍𝐞𝐱𝐭-𝐆𝐞𝐧 𝟐.𝟎 𝐆𝐇𝐳 𝐐𝐮𝐚𝐝-𝐂𝐨𝐫𝐞 𝐏𝐫𝐨𝐜𝐞𝐬𝐬𝐨𝐫: Experience power and precision with a state-of-the-art processor that effortlessly manages high throughput. Eliminate lag and enjoy fast connections with minimal latency, even during heavy data transmissions.
  • 𝐂𝐨𝐯𝐞𝐫𝐚𝐠𝐞 𝐟𝐨𝐫 𝐄𝐯𝐞𝐫𝐲 𝐂𝐨𝐫𝐧𝐞𝐫 - Covers up to 2,000 sq. ft. for up to 60 devices at a time. 4 internal antennas and beamforming technology focus Wi-Fi signals toward hard-to-reach areas. Seamlessly connect phones, TVs, and gaming consoles.

How operators diagnose a 504

  1. Record the event. Save the URL, method, timestamp with time zone, status, response headers, client or request ID, and affected region or data center.
  2. Identify the generating layer. Compare the response body and headers with origin responses, CDN error pages, proxy logs, and platform dashboards. Cloudflare distinguishes errors generated by Cloudflare from errors returned by an origin.
  3. Correlate logs. Use the request ID or Ray ID, where available, across CDN, reverse-proxy, load-balancer, application, and dependency logs.
  4. Test the origin directly where safe. Bypass the public proxy using an internal route or controlled host entry. Do not expose an administrative origin or weaken access controls just to test.
  5. Measure the critical path. Break total latency into queue time, application time, database calls, external requests, and response transfer.
  6. Check health and capacity. Review CPU, memory, disk and network saturation, worker counts, connection pools, restarts, autoscaling events, and database limits.
  7. Review recent changes. Deployments, configuration edits, DNS or firewall changes, certificate updates, and dependency incidents often align with the first 504s.
  8. Fix the bottleneck, then align limits. Optimize or isolate slow work, add capacity, repair routing, or use asynchronous processing. Only after that should you adjust proxy and application timeouts consistently.

Safe direct-request examples

Use a diagnostic request that does not mutate data. Replace the host and path with an approved origin endpoint:

curl -i --max-time 30 https://example.com/health

Compare timing and headers from the public URL and the controlled origin path. A fast origin with a slow public response points toward the proxy, network path, or proxy-to-origin configuration; a slow origin keeps the investigation behind the proxy.

Cloudflare-specific clues

When Cloudflare is in the path, its error analytics can expose the requested URL, source IP address, Cloudflare data center, and Ray ID. Use those fields to separate a regional pattern from an origin-wide problem and to locate the corresponding request in your own logs. Determine first whether Cloudflare generated the page or merely forwarded an origin-generated error; the remediation differs.

Troubleshooting checklist by symptom

Only one URL returns 504

  • Profile that route’s database queries and external calls.
  • Check whether its response size or generated workload is unusual.
  • Look for a route-specific lock, queue, or authorization dependency.

Every URL returns 504

  • Check origin reachability from the proxy or CDN.
  • Inspect crashed processes, failed deployments, firewall rules, and DNS.
  • Verify that the load balancer has healthy backends and available connections.

Errors occur only in one region

  • Compare CDN data centers, routing, regional origins, and firewall decisions.
  • Check whether a dependency or origin pool is unavailable only in that region.

504s began after a timeout change

  • Map every timeout in the request path and its unit.
  • Ensure an outer proxy does not expire before an inner operation can finish.
  • Do not simply raise all values; long waits consume workers and can worsen overload.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Capturing a failing page for a bug report

A screenshot preserves the visible error page, timestamp, and request identifier, but it cannot replace logs. If you need repeatable captures for incident records, use a controlled browser or screenshot service and avoid submitting credentials or sensitive query strings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
  • Dual band router upgrades to 1200 Mbps high speed internet (300mbps for 2.4GHz plus 900Mbps for 5GHz), reducing buffering and ideal for 4K stream
  • Full Gigabit Ports - Gigabit Router with 4 Gigabit LAN ports, ideal for any internet plan and allow you to directly connect your wired devices
  • Boosted Coverage - Four external antennas equipped with Beamforming technology extend and concentrate the Wi-Fi signals
  • MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
  • Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—let Claude, Cursor, or another MCP client capture pages.

One request returns PNG, JPEG, WebP, or PDF. The service supports full-page and selector captures, device and viewport settings, dark mode, retina scale, custom CSS or JavaScript, clicks, waits, blocked resources, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for options and response headers. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.

Cost, performance, and reliability considerations

  • Timeouts are capacity decisions. A longer limit may help a legitimate report job but can hold connections and workers, increasing failures under load.
  • Prefer bounded work. Paginate large queries, cache safe results, move long exports to background jobs, and return a job status instead of keeping a browser request open.
  • Use retries carefully. Retry only idempotent operations, apply exponential backoff and jitter, and cap attempts. Retrying a saturated origin can amplify an outage.
  • Monitor percentiles. Average latency can look healthy while a long tail exceeds the proxy deadline. Track route-level latency, timeout counts, dependency timing, and saturation.
  • Make failures diagnosable. Preserve request IDs across layers, log timeout reasons, and include enough context to distinguish origin-generated and proxy-generated responses without exposing secrets.

Frequently Asked Questions

Does refreshing fix a 504 permanently?

No. A reload may succeed if the timeout was transient, but recurring 504 responses require the site owner to investigate the upstream path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can a DNS change cause a 504?

Yes. Incorrect or partially propagated DNS can send a proxy toward an unreachable or wrong origin, although the exact symptom depends on the proxy and network configuration.

Should I increase the timeout when a 504 appears?

Only after identifying why the request is slow. Raising a limit without fixing the bottleneck can consume more connections and make overload worse.

The Bottom Line

A 504 is a gateway’s report that an upstream server did not answer in time. Visitors should retry once and report the URL, time zone, screenshot, and request ID; operators should identify the generating layer and trace origin health, latency, dependencies, and capacity before changing timeout settings.

Quick Recap

SaleBestseller No. 1
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
TP-Link AX1800 WiFi 6 Router (Archer AX21 V5)
VPN SERVER: Archer AX21 Supports both Open VPN Server and PPTP VPN Server
$59.98
Bestseller No. 2
TP-Link AC1200 WiFi Router Dual Band Wireless Internet Router (Archer A54)
TP-Link AC1200 WiFi Router Dual Band Wireless Internet Router (Archer A54)
Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
$34.99
Bestseller No. 5
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
TP-Link AC1200 Gigabit Dual Band WiFi Router (Archer A6)
MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
$44.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.