Recommended Free Tools
Nginx upstream timed out (110) means NGINX, acting as a reverse proxy, could not complete one stage of its exchange with a backend before the applicable timeout expired. The text after the error identifies the stage: connecting, sending the request, waiting for response headers, or reading the response body. The client commonly receives HTTP 504 Gateway Timeout when NGINX gives up.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Do not begin by blindly increasing proxy_read_timeout. First identify the phase, measure where the delay occurs, and then decide whether the remedy is a network fix, an application-capacity fix, a retry-policy change, or a deliberately longer timeout.
As an Amazon Associate I earn from qualifying purchases.
What “upstream timed out (110)” means
Linux error 110 is a timeout condition. In an NGINX error log, the surrounding phrase is more useful than the number itself:
| Error-log suffix | What NGINX was waiting for | Typical investigation |
|---|---|---|
while connecting to upstream |
A TCP connection, and possibly the TLS handshake, to the backend | Resolve the exact address, test the port from the NGINX host, and inspect routing, firewalls, listeners, accept queues, and backend availability. |
while sending request to upstream |
Progress while writing the client request to the backend | Check whether the backend is reading, whether uploads are buffered appropriately, and whether the network or backend is saturated. |
while reading response header from upstream |
Initial response headers after NGINX sent the request | Inspect application work such as database queries, worker queues, CPU, memory, and downstream calls. |
while reading upstream |
More response bytes after the backend had started replying | Look for stalled generation, slow storage, compression, client backpressure, or a stream with no heartbeat. |
These are different failure modes. A backend that accepts a connection but spends two minutes preparing a report has a header-read problem, not a connection problem. A WebSocket that sends no bytes for longer than its idle read timeout has a body-read problem even when the connection itself is healthy.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
NGINX proxy timeouts: defaults and exact semantics
Current NGINX proxy-module documentation lists 60 seconds as the default for each of the three principal proxy timers. The timers are not total-operation clocks; they measure inactivity between specific I/O events.
| Directive | Default | Measures | Important limitation |
|---|---|---|---|
proxy_connect_timeout |
60s | Time to establish a connection to the upstream | NGINX documents that this usually cannot exceed approximately 75 seconds, because the underlying network operation often imposes that practical limit. |
proxy_send_timeout |
60s | Idle time between successive writes while sending the request | It is not a fixed maximum upload duration. A continuously progressing upload can last longer than 60 seconds. |
proxy_read_timeout |
60s | Idle time between successive reads from the upstream | It is not a fixed maximum response duration. A backend that periodically sends bytes can remain connected beyond 60 seconds. |
For a response, NGINX resets the read timer whenever it successfully reads data. Consequently, a long-running stream can be safe with a 60-second setting if it emits data more often than once per minute, while a short response can fail if the backend pauses for more than 60 seconds between chunks.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Fixing “while connecting to upstream”
What the phase tells you
NGINX did not complete the upstream connection before proxy_connect_timeout expired. Common causes include a wrong hostname or port, a backend process that is stopped, firewall or security-group rules, a route failure, DNS returning an unreachable address, IPv6 being selected when only IPv4 works, a delayed TLS handshake, an overloaded accept queue, or a listener that has run out of capacity.
Checks from the NGINX host
- Read the complete error-log line, including the resolved upstream address and port. Do not test a different address than the one NGINX selected.
- Resolve the name using the same resolver path available to the NGINX host. Compare A and AAAA results and test each address if both are returned.
- Test TCP reachability to the exact port from the NGINX machine. A successful DNS lookup does not prove that a connection can be established.
- On the backend, verify that the service is listening on the expected interface and port. Check service logs, process limits, kernel listen/backlog pressure, and recent restarts.
- Review firewall, routing, container-network, and load-balancer rules in both directions.
Raise proxy_connect_timeout only when measurements show that legitimate connection or handshake latency needs more time. The documented default is 60 seconds, and a value far above the approximately 75-second practical ceiling is not a reliable fix for a broken route or a dead listener.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Fixing “while sending request to upstream”
What the phase tells you
NGINX connected, but it could not continue writing the request. The upstream may have stopped reading, the path may be congested, request buffering may not suit a large upload, or the backend may be so overloaded that it cannot consume incoming data.
Checks and remedies
- Confirm the request size and whether the failure occurs only with large uploads or slow clients.
- Check backend receive behavior, application upload limits, worker availability, and socket receive pressure.
- Examine request buffering and any configuration that streams the client body directly to the upstream.
- Measure network throughput and retransmissions between NGINX and the backend.
- Increase
proxy_send_timeoutonly after confirming that slow but valid writes are expected. Because the directive measures idle gaps between writes, it does not create a simple total upload budget.
If the backend cannot keep up, a larger send timeout can make more connections wait and worsen saturation. Capacity, flow control, and upload design should be corrected before adding a generous timer.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Fixing “while reading response header from upstream”
Why this is usually an application-latency problem
In this phase the backend accepted the request, but NGINX did not receive response headers before the read idle timer expired. Typical causes are a slow database query, a call to another service, exhausted worker pools, CPU or memory pressure, lock contention, queueing, or a report-generation task that should not run synchronously in an HTTP request.
How to investigate
- Correlate the NGINX request with the backend access log and application trace using a request ID or timestamp.
- Measure time spent in database calls, external APIs, template rendering, file generation, and lock waits.
- Check worker utilization, queue depth, CPU, memory, garbage collection, and database connection pools while the timeout occurs.
- Compare the observed latency distribution, including high-percentile values, with the configured
proxy_read_timeout. - Decide whether the operation should be optimized, queued for asynchronous processing, cached, or allowed a longer synchronous budget.
Increasing proxy_read_timeout is appropriate when the operation is expected to take longer and the backend has enough capacity to hold those requests. It is not a substitute for fixing an accidentally unbounded query or an exhausted worker pool.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Fixing “while reading upstream”
What changes after headers arrive
Here the backend started responding, then stopped sending bytes for longer than the read idle interval. Investigate slow result generation, disk or object-storage reads, compression, application pauses, client backpressure, and failures in a streaming pipeline.
Streaming and WebSocket connections
For a streaming response, make sure the producer emits data often enough to satisfy the idle interval or choose a timeout that matches the intended heartbeat. NGINX WebSocket documentation states that a proxied connection closes by default when the server sends no data for 60 seconds. A WebSocket application can therefore keep a connection alive either by setting a larger proxy_read_timeout or by sending periodic ping or heartbeat frames. The heartbeat interval must be shorter than the idle timeout, with room for network jitter and processing delays.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsWhy a 504 can appear even when one backend is healthy
The directive proxy_next_upstream defaults to error timeout. When an eligible connection, request-transmission, response-header, or timeout error occurs, NGINX may try the next server in the upstream group, provided it has not already sent a response to the client. The client can therefore see a delay caused by several attempts rather than the first failed attempt alone.
Retries can hide an intermittent backend failure in the client-facing logs while consuming capacity on the servers that remain healthy. Bound the retry budget with:
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
proxy_next_upstream_timeoutfor the maximum time spent trying upstreams.proxy_next_upstream_triesfor the maximum number of upstream attempts.
Be especially careful with non-idempotent requests. NGINX does not normally retry methods such as POST after the request has been sent unless the non_idempotent option is enabled. Retrying a request that may have reached the application can duplicate a payment, write, or other side effect.
How passive failure marking affects the result
In an upstream group, the documented defaults are max_fails=1 and fail_timeout=10s. After the configured number of unsuccessful attempts during the fail interval, NGINX can temporarily consider a server unavailable for the fail-timeout period. These settings influence which server receives the next attempt; they do not repair the original timeout.
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 minuteNGINX’s HTTP health-check documentation notes that a single-server upstream group ignores these passive marking parameters. With only one backend, there is no alternate server to select, so direct availability, capacity, and latency monitoring are essential.
A safe diagnostic workflow
- Capture the complete error. Record the timestamp, request path, upstream address, and exact suffix such as
while reading response header from upstream. - Confirm the client result. A 504 usually means NGINX abandoned an upstream wait, but verify whether another proxy, gateway, or application generated the status.
- Inspect the active configuration. Run
nginx -Tand locate the effectiveproxy_connect_timeout,proxy_send_timeout,proxy_read_timeout, and upstream settings in the applicablehttp,server, orlocationcontext. - Correlate timings. Compare NGINX access logs with backend logs and, when configured, the variables
$upstream_connect_time,$upstream_header_time, and$upstream_response_time. - Test every upstream address. From the NGINX host, verify DNS results and TCP connectivity to every address and port in the group.
- Inspect backend pressure. Check worker availability, queue depth, CPU, memory, database latency, connection pools, and kernel listen/backlog statistics.
- Look for retries. Comma-separated upstream timing values can indicate attempts across multiple servers. A single client request may have consumed the timeout budget more than once.
- Change one thing. Apply the smallest phase-specific change, run
nginx -t, reload, and inspect the error log for confirmation.
Configuration examples
Expected slow report endpoint
The following deliberately gives a report operation more time to produce headers while bounding retries. These values are examples, not universal recommendations; match them to measured network and application budgets.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
location /reports/ {
proxy_pass http://reports_backend;
proxy_connect_timeout 10s;
proxy_send_timeout 30s;
proxy_read_timeout 180s;
proxy_next_upstream error timeout;
proxy_next_upstream_timeout 20s;
proxy_next_upstream_tries 2;
}
A 180-second read timeout does not guarantee a 180-second total response. It allows up to 180 seconds of inactivity between reads. If the report is unpredictable or resource-intensive, queue it and let the client poll for completion instead of holding a proxy connection open.
WebSocket endpoint
location /chat/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 10m;
}
The upstream application must send heartbeat or other data often enough to fit the selected idle timeout. The Connection value assumes that $connection_upgrade is defined in the surrounding configuration according to the WebSocket setup being used.
When a timeout change appears to do nothing
First verify that the edited file is actually included and that the directive is in the context serving the failing request. A timeout in one server or location block does not affect a different matched block.
- Run
nginx -t. Do not reload an invalid configuration. - Run
nginx -Tand confirm the rendered configuration contains the new value in the active block. - Reload NGINX using the service manager or
nginx -s reload, then inspect the error log and service status. - Check that the master process accepted the reload and that workers were replaced as expected.
- Repeat a controlled request and compare its upstream timing fields with the previous attempt.
If the changed timeout still appears ignored, the reload may not have succeeded. Maxim Dounin, an NGINX maintainer, summarized that situation as: “This suggests that reload wasn’t successful for some reason.” Treat the reload as an operational event to verify, not as a command whose success can be assumed.
Choosing a fix instead of merely increasing a timer
| Observed condition | Prefer this action | Avoid |
|---|---|---|
| Connection cannot reach the listener | Fix address selection, routing, firewall, service state, or backlog pressure. | Setting an extremely large connect timeout. |
| Large uploads pause while the backend stops reading | Fix upload buffering, receive behavior, worker capacity, or network congestion. | Assuming a larger send timeout creates a larger total upload allowance. |
| Headers arrive after a predictable long computation | Optimize or queue the work; otherwise set a measured read budget and monitor capacity. | Using a high timeout to conceal unbounded application latency. |
| Response pauses between chunks | Fix the producer or add heartbeats; set an idle timeout compatible with the stream. | Confusing idle timeout with total response duration. |
| Several upstreams are retried | Bound retry time and count, and verify request idempotency. | Allowing retries to multiply load during an outage. |
Monitoring that prevents repeat incidents
Alert on each upstream phase separately rather than treating every 504 as the same event. Track connection time, time to response headers, total upstream response time, retry counts, backend queue depth, worker saturation, database latency, and the percentage of requests that end in 504. For streaming services, monitor heartbeat gaps and connection duration. For a single-server group, add direct health and capacity checks because passive fail marking cannot move traffic elsewhere.
Use the smallest timeout that accommodates the documented workload and its measured tail latency. Pair every increase with a capacity review: a longer timeout allows more concurrent requests to remain open, which can consume workers, memory, sockets, database connections, and load-balancer capacity during a slowdown.
Quick Recap
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.




