Error map
upstream prematurely closed connection while reading response header Nginx: [error] upstream prematurely closed connection while reading response header from upstream
Nginx / Apache · layer 3, Edge & web server
Centre: this error. First ring: errors it is linked with (7). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.
Directly related (7)
Nginx: upstream timed out (110: Connection timed out) while reading response header from upstream
Nginx waited longer than proxy_read_timeout (60 s default) for the backend (app server, PHP-FPM) to respond, then returned 504.
HTTP 502 Bad Gateway
A proxy or gateway (Nginx, load balancer, CDN) got an invalid response — or no response — from the upstream server behind it.
Nginx: nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:5
Nginx couldn't resolve the hostname in an `upstream`/`proxy_pass` at startup.
Apache: [proxy_http:error] AH01102: error reading status line from remote server 127.0.0.1:3000 / AH00898: Error reading from remote server returned by /api
mod_proxy couldn't read a valid response from the backend, so Apache returned 502/503.
Nginx: [error] no live upstreams while connecting to upstream (503/502)
All servers in an `upstream` group are marked unavailable, so Nginx has nothing to proxy to.
Nginx: [error] recv() failed (104: Connection reset by peer) while reading response header from upstream
The upstream (PHP-FPM, Node, Gunicorn) closed the connection abruptly while Nginx waited for the response.
Nginx: [error] connect() failed (111: Connection refused) while connecting to upstream, upstream: "http://127.0.0.1:3000/"
Nginx tried to proxy a request but nothing listens on the upstream address, so the client gets 502.
Two steps away (19)
MySQL ERROR 2006 (HY000): MySQL server has gone away
The connection to MySQL was closed — usually by a timeout or a packet larger than `max_allowed_packet`.
HTTP 408 Request Timeout
The server closed the connection because the client took too long to send the complete request.
HTTP 504 Gateway Timeout
A proxy or gateway waited too long for the upstream server to respond and gave up.
Error: connect ECONNREFUSED 127.0.0.1:5432
Nothing is listening at that host:port — the target service is down or you’re connecting to the wrong address.
HTTP 407 Proxy Authentication Required
A proxy between you and the server requires credentials before it will forward your request.
HTTP 500 Internal Server Error
The server hit an unexpected condition — usually an unhandled exception or misconfiguration in the application.
cURL error 6: Could not resolve host: api.example.com
PHP cURL couldn’t resolve the hostname via DNS.
sudo: unable to resolve host <hostname>: Name or service not known
The machine’s hostname isn’t in /etc/hosts (or DNS), so sudo prints this warning — usually after changing the hostname.
ping: google.com: Temporary failure in name resolution
The Linux host can’t resolve domain names — no working DNS server is configured or reachable.
HTTP 417 Expectation Failed
The server or a proxy can’t meet the Expect header in the request — almost always Expect: 100-continue.
HTTP 511 Network Authentication Required
A captive portal (hotel, airport, office Wi-Fi) is intercepting your traffic until you log in or accept its terms.
Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name
A harmless startup warning: Apache has no global ServerName, so it guessed one from the host’s IP.
Nginx: [error] client intended to send too large body: 5242880 bytes (413 Request Entity Too Large)
A request body exceeded `client_max_body_size` (default 1 MB), so Nginx returned 413 before reaching your app.
Nginx/Apache: ModSecurity: Access denied with code 403 (phase 2). Matched "Operator GE matched 5 at TX:anomaly_score"
The ModSecurity WAF (OWASP Core Rule Set) blocked the request as suspicious.
Nginx: [error] upstream sent too big header while reading response header from upstream (502 Bad Gateway)
The backend's response headers (cookies, Set-Cookie, long headers) exceeded Nginx's proxy/fastcgi buffer size.
Nginx: [info] client prematurely closed connection while reading response header from upstream / access log status 499
The client (browser, mobile app, load balancer) disconnected before Nginx finished the response; Nginx logs status 499.
Nginx: [crit] connect() to unix:/run/php/php8.3-fpm.sock failed (13: Permission denied) while connecting to upstream
Nginx can't open the PHP-FPM (or app) Unix socket because of socket ownership/permissions or SELinux.
Browser: WebSocket connection to 'wss://example.com/socket' failed: Error during WebSocket handshake: Unexpected response code: 400 (nginx proxy)
Nginx isn't forwarding the `Upgrade`/`Connection` headers needed for WebSockets.
Nginx: reverse proxy returns 404 — location /api/ { proxy_pass http://app:3000/; } strips the prefix (or keeps it)
Whether `proxy_pass` has a URI part decides if the matched prefix is stripped, so the backend receives an unexpected path.
Map another error
Popular: 500403400ORA-009331064Critical errorFileNotFoundException assemblyTypeError