Topic cluster

Troubleshooting proxies

Read 502, 503 and 504 correctly, drive curl through a proxy, understand no_proxy, survive a corporate proxy, and bisect a chain methodically.

17 guides · cluster reviewed 18 October 2026

Most proxy debugging goes wrong in the first minute, because the investigation starts at the layer that reported the error rather than the layer that caused it. A proxy reports what it experienced, which is usually a symptom of something one hop further in.

The method that works is always the same: draw the chain, bisect it, and find the innermost hop that still shows the fault. A proxy debugging playbook is the long form of that method, and everything else in this cluster is a specific case of it.

By symptom#

SymptomStart here
502, 503 or 504502 vs 503 vs 504
Intermittent 502 under loadKeep-alive and upstream connection pooling
504 with no upstream log lineTimeout budgets
499 in the nginx access log, ALB 460, Envoy DCWhat nginx 499 means, and its HAProxy, Envoy and ALB names
connect() failed (111) to [::1] with proxy_pass http://localhostWhy nginx tries ::1 when proxy_pass says localhost
SSL_do_handshake() failed ... while SSL handshaking to upstream, or upstream SSL certificate verify errorWhy nginx fails the TLS handshake to an HTTPS upstream
502 after restarting a Docker containernginx 502 after a Docker container restart
worker_connections are not enough, or Too many open filesWhat worker_connections should be on a reverse proxy
Access-Control-Allow-Origin contains multiple valuesWhy the CORS header appears twice behind a proxy
Large downloads stop early: ERR_CONTENT_LENGTH_MISMATCH, curl error 18Why nginx cuts off large downloads
upstream sent no valid HTTP/1.0 header, status 009, or Received HTTP/0.9 when not allowedWhy nginx logs no valid HTTP/1.0 header
upstream sent too big headerHeader and body size limits
Wrong client IP in the logsConfiguring trusted proxies
Infinite redirect loop over HTTPSX-Real-IP, X-Forwarded-Proto, Host and Port
404 only for one path prefixnginx proxy_pass and the trailing slash
Some tools bypass the proxy, others do notThe no_proxy environment variable
unable to get local issuer certificateTLS interception and corporate root CAs
npm, pip, git or docker failing at workCorporate proxies and developer tooling
wrong version number or Your proxy appears to only use HTTP through a proxyShould HTTPS_PROXY start with http:// or https://?
407 from every dev tool behind an NTLM or Kerberos proxyCntlm or Px: which local auth proxy to use
Windows proxy set in Settings, a service or tool still goes directnetsh winhttp vs Windows proxy settings

The one tool to learn properly#

curl through a proxy is worth reading even if you already use curl daily. The --write-out timing breakdown alone will localise most latency problems to a single hop in one command.

Every guide in this cluster#