Error map

upstream sent too big header while reading response header Nginx: [error] upstream sent too big header while reading response header from upstream (502 Bad Gateway)

Nginx / Apache · layer 3, Edge & web server

Open the full error page →

Centre: this error. First ring: errors it is linked with (8). 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.

upstream sent too big header while reading response header — Nginx: [error] upstream sent too big header while reading response header from upstream (502 Bad Gateway) (Nginx / Apache)upstream se…502 — HTTP 502 Bad Gateway (HTTP)502FastCGI sent in stderr: PHP message — Nginx: [error] FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect()" while reading response header from upstream (Nginx / Apache)FastCGI sent in std…SSL_do_handshake() failed while SSL handshaking to upstream — Nginx: [error] SSL_do_handshake() failed (SSL: error:0A000410:SSL routines::sslv3 alert handshake failure) while SSL handshaking to upstream (Nginx / Apache)SSL_do_handshake() …WebSocket connection failed through Nginx (missing Upgrade headers) — Browser: WebSocket connection to 'wss://example.com/socket' failed: Error during WebSocket handshake: Unexpected response code: 400 (nginx proxy) (Nginx / Apache)WebSocket connectio…recv() failed (104: Connection reset by peer) while reading response header — Nginx: [error] recv() failed (104: Connection reset by peer) while reading response header from upstream (Nginx / Apache)recv() failed (104:…proxy_pass with a URI changes the path (404 from upstream) — Nginx: reverse proxy returns 404 — location /api/ { proxy_pass http://app:3000/; } strips the prefix (or keeps it) (Nginx / Apache)proxy_pass with a U…414 Request-URI Too Large / 400 Request Header Or Cookie Too Large — Nginx: 400 Bad Request — Request Header Or Cookie Too Large / client sent too long header line (Nginx / Apache)414 Request-URI Too…no resolver defined to resolve example.com — Nginx: [error] no resolver defined to resolve api.example.com, client: 203.0.113.5 (502 when proxy_pass uses a variable) (Nginx / Apache)no resolver defined…ECONNREFUSED — Error: connect ECONNREFUSED 127.0.0.1:5432 (Node.js)ECONNREFUSED407 — HTTP 407 Proxy Authentication Required (HTTP)407500 — HTTP 500 Internal Server Error (HTTP)500Primary script unknown — FastCGI sent in stderr: "Primary script unknown" (PHP)Primary script unkn…OPcache stale code — PHP still runs old code after deploy (OPcache not reset) (PHP)OPcache stale codenginx: client intended to send too large body — Nginx: [error] client intended to send too large body: 5242880 bytes (413 Request Entity Too Large) (Nginx / Apache)nginx: client inten…525 — Cloudflare Error 525: SSL Handshake Failed (Cloudflare)525526 — Cloudflare Error 526: Invalid SSL Certificate (Cloudflare)526sslv3 alert handshake failure — OpenSSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure (SSL alert number 40) (SSL / TLS)sslv3 alert handsha…400 — HTTP 400 Bad Request (HTTP)400Cloudflare 502 — Cloudflare-branded 502 Bad Gateway / 504 Gateway Timeout ("cloudflare" footer) (Cloudflare)Cloudflare 502connect() failed (111: Connection refused) while connecting to upstream — Nginx: [error] connect() failed (111: Connection refused) while connecting to upstream, upstream: "http://127.0.0.1:3000/" (Nginx / Apache)connect() failed (1…no live upstreams while connecting to upstream — Nginx: [error] no live upstreams while connecting to upstream (503/502) (Nginx / Apache)no live upstreams w…upstream prematurely closed connection while reading response header — Nginx: [error] upstream prematurely closed connection while reading response header from upstream (Nginx / Apache)upstream prematurel…nginx: host not found in upstream — Nginx: nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:5 (Nginx / Apache)nginx: host not fou…404 — HTTP 404 Not Found (HTTP)404405 — HTTP 405 Method Not Allowed (HTTP)405path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexpHeaders already sent — Warning: Cannot modify header information - headers already sent (PHP)Headers already sent411 — HTTP 411 Length Required (HTTP)411428 — HTTP 428 Precondition Required (HTTP)428cURL error 6 — cURL error 6: Could not resolve host: api.example.com (PHP)cURL error 6511 — HTTP 511 Network Authentication Required (HTTP)511sudo: unable to resolve host — sudo: unable to resolve host <hostname>: Name or service not known (Linux)sudo: unable to res…

Directly related (8)

502HTTP

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.

FastCGI sent in stderr: PHP messageNginx / Apache

Nginx: [error] FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect()" while reading response header from upstream

PHP wrote an error to stderr while handling the request, so Nginx logs it (often a 500/502 follows).

SSL_do_handshake() failed while SSL handshaking to upstreamNginx / Apache

Nginx: [error] SSL_do_handshake() failed (SSL: error:0A000410:SSL routines::sslv3 alert handshake failure) while SSL handshaking to upstream

Nginx couldn't complete TLS to an HTTPS backend (`proxy_pass https://...`), so clients get 502.

WebSocket connection failed through Nginx (missing Upgrade headers)Nginx / Apache

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.

recv() failed (104: Connection reset by peer) while reading response headerNginx / Apache

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.

proxy_pass with a URI changes the path (404 from upstream)Nginx / Apache

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.

414 Request-URI Too Large / 400 Request Header Or Cookie Too LargeNginx / Apache

Nginx: 400 Bad Request — Request Header Or Cookie Too Large / client sent too long header line

The request line or headers (often cookies) exceed `large_client_header_buffers`.

no resolver defined to resolve example.comNginx / Apache

Nginx: [error] no resolver defined to resolve api.example.com, client: 203.0.113.5 (502 when proxy_pass uses a variable)

`proxy_pass` with a variable (or `set $upstream`) needs a `resolver`, which isn't configured.

Two steps away (24)

ECONNREFUSEDNode.js

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.

407HTTP

HTTP 407 Proxy Authentication Required

A proxy between you and the server requires credentials before it will forward your request.

500HTTP

HTTP 500 Internal Server Error

The server hit an unexpected condition — usually an unhandled exception or misconfiguration in the application.

Primary script unknownPHP

FastCGI sent in stderr: "Primary script unknown"

Nginx passed a script path to PHP-FPM that PHP-FPM couldn’t find — usually a wrong SCRIPT_FILENAME or root.

OPcache stale codePHP

PHP still runs old code after deploy (OPcache not reset)

OPcache keeps serving cached bytecode, so changes uploaded to the server don’t take effect.

nginx: client intended to send too large bodyNginx / Apache

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.

525Cloudflare

Cloudflare Error 525: SSL Handshake Failed

Cloudflare couldn’t complete a TLS handshake with your origin (SSL mode Full / Full strict).

526Cloudflare

Cloudflare Error 526: Invalid SSL Certificate

With SSL mode Full (strict), the origin’s certificate is expired, self-signed, or doesn’t match the hostname.

sslv3 alert handshake failureSSL / TLS

OpenSSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure (SSL alert number 40)

The server aborted the handshake with alert 40 — no acceptable parameters (cipher, signature algorithm, client certificate or SNI…

400HTTP

HTTP 400 Bad Request

The server could not understand the request because its syntax, headers or body are malformed or invalid.

Cloudflare 502Cloudflare

Cloudflare-branded 502 Bad Gateway / 504 Gateway Timeout ("cloudflare" footer)

A plain-looking 502/504 page with “cloudflare” at the bottom comes from Cloudflare’s network itself (or an origin response it cou…

connect() failed (111: Connection refused) while connecting to upstreamNginx / Apache

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.

no live upstreams while connecting to upstreamNginx / Apache

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.

upstream prematurely closed connection while reading response headerNginx / Apache

Nginx: [error] upstream prematurely closed connection while reading response header from upstream

The backend ended the connection before sending a complete response header.

nginx: host not found in upstreamNginx / Apache

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.

404HTTP

HTTP 404 Not Found

The server can’t find anything at the requested URL.

405HTTP

HTTP 405 Method Not Allowed

The URL exists, but it doesn’t accept the HTTP method you used (e.g. POST to a GET-only route).

path-to-regexpNode.js

TypeError: Missing parameter name at 1 (path-to-regexp)

An Express 5 (path-to-regexp v8) route uses old wildcard syntax like '*' or '/:id?'.

Headers already sentPHP

Warning: Cannot modify header information - headers already sent

You called `header()`, `setcookie()` or `session_start()` after output had already been sent to the browser.

411HTTP

HTTP 411 Length Required

The server refuses a request with a body but no Content-Length header.

428HTTP

HTTP 428 Precondition Required

The server requires a conditional request (If-Match / If-Unmodified-Since) to prevent lost updates, and you didn’t send one.

cURL error 6PHP

cURL error 6: Could not resolve host: api.example.com

PHP cURL couldn’t resolve the hostname via DNS.

511HTTP

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.

sudo: unable to resolve hostLinux

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.