iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
A 504 Gateway Timeout means a gateway or proxy did not receive a response from an upstream server before its waiting limit expired. The intermediary sends the 504 page, but the delay could be in the origin application, database, API, network path, CDN, reverse proxy or load balancer. It does not, by itself, prove that your internet connection failed. Visitors can retry and check their local network; site operators must identify the layer that timed out and repair the measured bottleneck.
| Symptom | Likely cause | First fix |
|---|---|---|
| Cloudflare-branded 504 page | Cloudflare or the origin could not complete the request in time | Retry; the operator should compare Cloudflare and origin logs |
| CloudFront error page | CloudFront could not connect to the target or the target exceeded the idle timeout | Check target reachability and response time against the configured timeout |
| 504 from an application page | Application work or a downstream database/API exceeded its budget | Find and reduce the slow operation |
| ALB-generated 504 | Load-balancer connection or idle timeout, target failure, or no response | Inspect target health, connection timeout and idle timeout |
| Unbranded 504 passing through Cloudflare | An upstream origin or intermediary generated the response | Trace response headers and each proxy hop |
Timeout behavior and provider labels checked Nov 2026.
What does 504 Gateway Timeout mean?
HTTP status 504 is defined as a gateway or proxy not receiving a timely response from an upstream server needed to complete the request. The intermediary that stopped waiting returns the status to your browser; the status does not identify which upstream component is unhealthy. The normative definition is in the HTTP Semantics specification (RFC 9110).
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors“Upstream” may be the website’s origin server, an application process, a database, an API, a service behind a load balancer, or another proxy. A CDN can also be the intermediary. Consequently, a 504 can be caused by slow application code, slow database queries, a failed downstream dependency, network or routing problems, exhausted connections, or a timeout set shorter than a legitimate operation requires.
Popular on Amazon
- Top Technology--8K@60HZ: This 8K Ultra-High Speed 2.1 HDMI Cable uses the most cutting-edge technology, which is compatible with 8K@60HZ,4K@240HZ and 4K@120HZ clearly displays every particle, and accurately processes every signal source.
- Upgrade Revolution: Highwings Ultra High Speed HDMI Cable 2.1 8K supports 48Gbps (6GB/s) which can will no longer be stuck or dropped frames when watching video. It is also backward compatible with HDMI 2.0b/2.0a/1.4/1.3/1.2/1.1 versions.
- For Game Enthusiasts: This 8K Ultra High Speed HDMI Cable 2.1 can achieve a super smooth picture of 4K@120HZ. Its latest game mode supports variable refresh rate, maximizes the value of the graphics card and CPU to obtain a smoother and more detailed picture.
- Reinforced high-quality materials: This 8K HDMI Cord uses Highwings' most popular classic style. The tail's anti-bending design has been upgraded to make it more durable. The military grade tensile nylon material also greatly extends its life.
- The ultimate perfectionist: Highwings every parts of the cable has been put through rigorous the performance tests in the laboratory. After we've combined every flawless part into a perfect 8K cable and it can be presented to you.
Is a 504 error my internet or the website’s server?
Usually, a 504 concerns the website’s request path rather than a general failure of your internet connection. However, a VPN, custom proxy, firewall, DNS problem or route that affects only your connection can prevent the intermediary from completing the request. If other sites work and only one service shows 504, the service’s path is the stronger initial suspect; if only some networks or users fail, client-side networking may be involved.
MDN describes 504 as a server-side gateway or proxy timeout and recommends retrying later or contacting the site operator when it persists. See the MDN 504 reference for the browser-facing definition.
What should a visitor do when a 504 appears?
Try the following in order. Stop once the service loads; repeated refreshes can add load to an already slow system.
- Reload once or twice. A transient overload or short network interruption may clear.
- Wait a few minutes and retry. Do not assume that changing a browser setting will repair a failing origin.
- Check the URL. Correct the hostname, path, spelling and protocol. A request sent to the wrong host can reach an unresponsive service.
- Try another network. Switch between a trusted wired connection and mobile data, or another permitted network. If one network works, investigate its DNS, routing, firewall or proxy.
- Disable a VPN or custom proxy temporarily. A proxy hop can add latency or block the upstream connection. Re-enable it after testing and follow your organization’s policy.
- Check the service’s status page. A provider may report an outage or maintenance window. If no status information exists, contact the site owner with the URL, time, timezone and any request ID shown.
Clearing cookies or reinstalling a browser rarely fixes a genuine upstream timeout. If the same URL fails from several networks, only the site operator can correct the origin or intermediary path.
Also popular on Amazon
- Superior Display, Swift Connectivity: Elevate your viewing experience to unparalleled clarity with 8K@60Hz, and enjoy smoother visuals and reduced lag with support for 4K@120Hz and 4K@60Hz.
- Quick and Seamless Video Transfer: With the latest HDMI technology, stream or transfer videos without interruptions, and witness the power of up to 48 Gbps in bandwidth, ensuring consistently clear content.
- Lasts Longer, Performs Stronger: This cable is designed to withstand up to 1,000 bends throughout its lifespan, meaning fewer replacements and continuous peace of mind.
- One Cable, Many Solutions: Whether you're connecting tablets, laptops, HDMI devices, projectors, or desktop screens, this cable effortlessly connects them all.
- What You Get: HDMI Cable (6 ft, 8K), welcome guide, 18-month warranty, and our friendly customer service.
How is 504 different from 502 Bad Gateway?
A 504 means the gateway did not get a response in time. A 502 Bad Gateway means the gateway did receive an upstream response, but that response was invalid or unusable. Both can be emitted by a CDN, reverse proxy or load balancer, and both require identifying the issuing layer rather than blaming the browser automatically.
For example, an application crash that closes a connection or sends malformed headers may produce 502, while a database query that never completes may lead to 504. A single outage can move between the two as a service changes from refusing connections to responding too slowly.
How can you tell which component generated the 504?
Start with the response headers and error-page appearance, then correlate the request across every hop.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute- Cloudflare-branded page: Cloudflare may be unable to contact the origin, or Cloudflare itself may have timed out. Cloudflare’s documentation notes that 502/504 responses can originate at the origin or at Cloudflare. Its guidance explains that an HTTP 502 or 504 indicates Cloudflare cannot establish contact with the origin; use the Cloudflare 502/504 troubleshooting page to distinguish branded responses and inspect origin logs.
- CloudFront error page: CloudFront lists failure to connect to a load-balancer target before the connection timeout and a target that does not respond before the idle timeout as possible 504 causes. Compare target reachability and response latency with those settings using the CloudFront 504 documentation.
- ALB-generated 504: An Application Load Balancer may time out while connecting to a target or while waiting for the target to send or finish a response. Check target health, access logs and load-balancer metrics. AWS’s troubleshooting guidance covers these branches in its ALB 504 article.
- Application-generated error page: A branded page rendered by the application may mean the application deliberately enforced a response timeout or caught a downstream failure. Inspect application logs and the operation named by the request.
- Unbranded error passing through Cloudflare: The origin or another intermediary may have generated the 504. Compare headers, server signatures, request IDs and timestamps at Cloudflare, the reverse proxy, load balancer and origin.
Do not infer the issuer from the status code alone. A CDN can forward an origin’s 504, and an origin can produce a page that looks like a CDN error.
Also popular on Amazon
- Certified UHD 8K HDMI 2.1 Cable: Highwings Certified Ultra High Speed UHD HDMI 2.1 Cable uses the most cutting-edge technology, is compatible with10K, 8K 60Hz, 4K 240Hz 120Hz, clearly displays every particle, and accurately processes every signal source
- Full-size HDMI only: Both ends are standard Type-A connectors (about 14mm wide) and do not fit mini HDMI (Tyoe-C, about 10 mm wide) or micro HDMI (Type-D, about 6 mm wide) ports found on cameras, action cameras, and slim laptops
- Upgraded Revolution-HDMI 2.1: Highwings UHD HDMI Cable 6ft conforms to the standard HDMI 2.1 version, it has a qualitative leap from 18Gbps to 48Gbps (6GB/s) directly for the transmission speed , there will no longer be stuck or dropped frames when watching video
- High-Quality Materials: Highwings 6ft UHD HDMI Cable uses the most popular classic style, the upgraded strength of the aluminum alloy shell and the tail's anti-bending design make it more durable.The military grade tensile nylon material greatly makes it last longer
- Design For Game Enthusiasts: This UHD HDMI CORD can achieve a super smooth picture of 4K@120Hz, 8K@60Hz and 10K. Its latest game mode supports variable refresh rate, maximizes the value of the graphics card and CPU, elevate gaming experience to a whole new level
How do operators troubleshoot a 504 Gateway Timeout?
Use this sequence for a website, API or internal service. Preserve the timestamp, URL, method, status, request ID and affected region before changing settings.
- Classify the scope. Determine whether every route fails, one expensive endpoint fails, or only users in one region or network fail. One-site failures point to that request path; failures across many services suggest local DNS, routing, VPN, proxy or firewall conditions.
- Find the issuer. Capture response headers and the complete error page. Inspect CDN, reverse-proxy, load-balancer and origin logs for the same request ID. This prevents fixing the wrong layer.
- Check reachability and connection attempts. From the relevant network, verify DNS resolution, routing, TLS/SSL connection establishment and the origin port. SSL connection delays, refused connections and packet loss can consume the connection timeout before application work begins.
- Check origin health and resource pressure. Look for high CPU or memory usage, process crashes, thread or worker starvation, file-descriptor limits and connection exhaustion. A saturated connection pool can make a healthy database appear unreachable.
- Find the slow operation. Use access-log duration, application traces and database/API timings to identify slow application code, slow database queries, serialization, compression, external calls or queue waits. Separate time spent connecting from time spent receiving and completing the response.
- Check failed downstream dependencies. Verify databases, APIs, caches, object stores and authentication services. A dependency that is down, rate-limiting, blocked or returning slowly can hold origin workers until the gateway gives up.
- Review network policy. Confirm firewall and security-group rules allow the intermediary’s addresses to reach the origin and dependency ports. Correct network policy, route tables, access-control lists and service-discovery records when they block legitimate traffic.
- Check response framing and compression. Incorrect response framing, such as invalid length or chunk boundaries, can prevent a proxy from recognizing completion. Verify headers, chunked encoding, content length and compression behavior; test with compression disabled to isolate a framing or decompression issue.
- Reproduce from the failing hop. Make a controlled request from the proxy or load-balancer network to the origin, then from the origin to each dependency. Record connection time, time to first byte and response completion time rather than relying on one total duration.
- Fix the measured cause. Restore a failed dependency, reduce request work, optimize database work, repair routing or access control, recycle a crashed process, or add capacity where CPU, memory, workers or connections are demonstrably saturated.
- Re-test while watching telemetry. Confirm that latency, 5xx rates, resource use and dependency errors improve at each layer. A successful single curl request does not prove that peak traffic is healthy.
When should you increase a timeout?
Increase a timeout only when measurements show that a legitimate operation needs more time and every lower layer can safely sustain that duration. Raising a limit without removing a bottleneck can make users wait longer, consume more workers and worsen a queue.
Review every timeout layer: DNS and connection attempts, SSL handshake, CDN origin response timeout, reverse-proxy response timeout, load-balancer connection and idle timeout, application deadline, database/API client timeout, and keep-alive timeout. The effective budget is constrained by the shortest relevant limit. A proxy may stop waiting while the application continues consuming resources.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Connection timeout: time allowed to establish a TCP/TLS connection to the next hop. Increase it only for a measured, predictable network or SSL delay; otherwise fix routing, capacity or packet loss.
- Response timeout: often the time to receive the first byte after connection. Slow application code or a blocked dependency should be fixed before extending it.
- Response completion timeout: the time allowed to receive the complete body. Large, streamed or compressed responses need an intentional budget and correct framing.
- Idle timeout: the maximum period with no bytes flowing. Streaming endpoints may need a longer value or periodic heartbeats; idle timeout changes do not fix a request that never starts responding.
- Keep-alive timeout: how long an idle persistent connection is retained. Align it across client, proxy, load balancer and origin so one side does not reuse a connection the other has already closed.
Document the timeout budget and leave headroom for retries, bursts and dependency variance. Set downstream client deadlines shorter than the caller’s deadline when possible, so the application can return a controlled error instead of being cut off by a gateway.
Also popular on Amazon
- Real 8K HDMI certified cable: The HDMI cables pass HDMI 2.1 Certified. The HDMI Cable delivers 10K 8K@60Hz and 4K@240Hz higher resolution, 4 times higher than 4K@60Hz. The advanced technology makes a remarkable improvement in image clarity and sharpness
- 48Gbps ultra high speed: The HDMI 2.1 Cable with 48Gbps bandwidth delivers uncompressed 8K(7680 x 4320) video and high-speed transmission without signal loss. Make it faster 2.6X than HDMI 2.0(18Gbps). The 4K@240Hz HDMI cord also supports variable refresh rates and QFT to decrease “display latency”. Auto low latency mode and quick media switching for movies and video use the HDMI VRR mechanism to eliminate the blackout period when an HDMI Source device switches its video mode
- Dynamic HDR & eARC: This HDMI Cable features Dynamic HDR to let you capture more details with 12-bit color accuracy and get breathtakingly realistic pictures. The function of eARC (Enhanced Audio Return Channel) directly delivers full-resolution audio, like Dolby Atmos, DTS:X from TV to soundbar/AV receiver. Also Support HDCP 2.3/2.2, Ethernet, 3D
- Enhanced durability: Built with a robust aluminum alloy case, nickel-plated connectors, and a durable nylon braided jacket, HDMI cables can withstand more frequent bending tests and decrease rupture without reducing cable flexibility, ensuring enhanced signal transmission performance and a longer lifespan
- Wide compatibility: Compatible with Apple TV/PS5/PS4 Pro/Roku Stick, Xbox Series X/S/Xbox 360, Nintendo Switch/Switch 2, Wii U, Mac mini M4/M4 Pro, Laptop, PC, Blu-ray player, AV Receiver, TV stick, TV Box, DVD player, LG 8K UHD TV, Samsung G8/G9 QLED TV, Soundbar, Projector, Monitor and more
What fixes a recurring 504 at the origin?
Choose the remedy that matches the evidence:
- Reduce request work: paginate large results, avoid unnecessary joins or remote calls, cache safe reads, move long jobs to asynchronous processing and return a job status instead of holding an HTTP request open.
- Optimize database work: inspect query plans, add appropriate indexes, remove N+1 queries, limit result size and maintain healthy connection pools. Do not simply raise the database or proxy timeout for an unbounded query.
- Improve application code: profile slow functions, eliminate blocking calls, set dependency deadlines and handle partial failures. A circuit breaker or bounded retry can stop one failing service from exhausting all workers.
- Add capacity: scale application instances, workers, memory, CPU, database capacity or connection pools when metrics show saturation. Capacity helps only when the constrained resource is the measured cause; adding servers will not repair a denied security-group rule or a bad route.
- Repair connectivity and policy: correct DNS records, routes, firewall rules, security groups, proxy allow-lists and TLS certificates. Verify the actual source addresses used by the CDN or load balancer.
- Correct response framing and compression: send valid status lines and headers, matching content length or valid chunked encoding. Check that compression middleware does not buffer indefinitely or emit inconsistent lengths.
How do you prevent 504 errors from returning?
Monitor both availability and latency. Use synthetic checks for important web and API routes from more than one network, alert on 5xx rates and high percentile latency, and trace requests across CDN, proxy, load balancer, application and dependencies. Keep dashboards for connection attempts, connection failures, CPU, memory, worker utilization, pool usage, database time and dependency time.
Set a documented timeout budget for each route, test slow and failed dependencies, and rehearse capacity limits. Alert before a pool or queue reaches exhaustion. Include the issuer, request ID, region, timing breakdown and recent configuration changes in incident records so operators can distinguish an origin failure from an intermediary timeout quickly.
What information should you send the site owner?
Provide the exact URL, UTC time and timezone, browser or client, network used, whether another network worked, the visible error-page branding, response headers or request ID, and the steps that reproduce it. Mention whether the problem affects one route or the entire site. Do not send passwords, tokens or private request data.
Recommended Free Tools
Frequently Asked Questions
Can a 504 damage my data or submit a form twice?
A timeout only describes the response path; the server may still have completed the operation. For payments, orders or other non-idempotent actions, check the account or confirmation record before retrying and use the service’s support channel if the result is unclear.
Also popular on Amazon
- Top Technology----8K@60HZ: This 8K Ultra High Speed HDMI Cable uses the most cutting-edge technology, is compatible with 8K@60HZ and 4K@120HZ, clearly displays every particle, and accurately processes every signal source.
- Upgrade Revolution: Highwings Ultra High Speed HDMI Cable supports 48Gbps (6GB/s) which can will no longer be stuck or dropped frames when watching video. It is also backward compatible with HDMI 2.0b/2.0a/1.4/1.3/1.2/1.1 versions.
- For Game Enthusiasts: This 8K Ultra High Speed HDMI Cable can achieve a super smooth picture of 4K@120HZ. Its latest game mode supports variable refresh rate, maximizes the value of the graphics card and CPU to obtain a smoother and more detailed picture.
- Reinforced high-quality materials: This 8K HDMI Cord uses Highwings' most popular classic style. The tail's anti-bending design has been upgraded to make it more durable. The military grade tensile nylon material also greatly extends its life.
- The ultimate perfectionist: Highwings every parts of the cable has been put through rigorous the performance tests in the laboratory. After we've combined every flawless part into a perfect 8K cable and it can be presented to you.
Why does a 504 disappear when I refresh?
The first request may have encountered a transient queue, overloaded worker or failed dependency while the next request reached a recovered instance. A disappearing error does not prove the system is healthy; recurring bursts should still be correlated with latency and capacity metrics.
Does changing DNS fix a 504?
Only when the selected DNS answer leads to a broken or unreachable route. DNS changes cannot make slow application code or a saturated database respond faster, and changing records during an incident can introduce additional propagation and cache effects.
Why do APIs show 504 more often than simple web pages?
API endpoints commonly perform synchronous database joins, authorization calls and service-to-service requests, so their response budget depends on several downstream systems. A static page may complete quickly while a data-heavy API exceeds the proxy or load-balancer deadline.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →

