Error map

connect() 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 · layer 3, Edge & web server

Open the full error page →

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

connect() 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() f…502 — HTTP 502 Bad Gateway (HTTP)502upstream 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…connect() to unix:/run/php/php-fpm.sock failed (13: Permission denied) — Nginx: [crit] connect() to unix:/run/php/php8.3-fpm.sock failed (13: Permission denied) while connecting to upstream (Nginx / Apache)connect() to unix:/…AH00898: Error reading from remote server (502 Proxy Error) — 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 (Nginx / Apache)AH00898: Error read…AH01114: HTTP: failed to make connection to backend — Apache: [proxy:error] AH00957: HTTP: attempt to connect to 127.0.0.1:3000 (127.0.0.1) failed / AH01114: HTTP: failed to make connection to backend: 127.0.0.1 (Nginx / Apache)AH01114: HTTP: fail…no live upstreams while connecting to upstream — Nginx: [error] no live upstreams while connecting to upstream (503/502) (Nginx / Apache)no live upstreams w…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…ModSecurity: Access denied with code 403 — Nginx/Apache: ModSecurity: Access denied with code 403 (phase 2). Matched "Operator GE matched 5 at TX:anomaly_score" (Nginx / Apache)ModSecurity: Access…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…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)500upstream timed out — Nginx: upstream timed out (110: Connection timed out) while reading response header from upstream (Nginx / Apache)upstream timed outcURL error 6 — cURL error 6: Could not resolve host: api.example.com (PHP)cURL error 6sudo: unable to resolve host — sudo: unable to resolve host <hostname>: Name or service not known (Linux)sudo: unable to res…Temporary failure in name resolution — ping: google.com: Temporary failure in name resolution (Linux)Temporary failure i…Primary 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: bind() to 0.0.0.0:80 failed (13: Permission denied) — Nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) (Nginx / Apache)nginx: bind() to 0.…417 — HTTP 417 Expectation Failed (HTTP)417511 — HTTP 511 Network Authentication Required (HTTP)511AH00558 — Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name (Nginx / Apache)AH00558503 — HTTP 503 Service Unavailable (HTTP)503AH00526: Syntax error on line of apache config — Apache: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.conf: Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration (Nginx / Apache)AH00526: Syntax err…AH00015: Unable to open logs — Apache: AH00091: apache2: could not open error log file /var/log/apache2/error.log. AH00015: Unable to open logs (Permission denied) (Nginx / Apache)AH00015: Unable to …nginx: 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…400 — HTTP 400 Bad Request (HTTP)400Cloudflare 502 — Cloudflare-branded 502 Bad Gateway / 504 Gateway Timeout ("cloudflare" footer) (Cloudflare)Cloudflare 502upstream 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 sent too b…403 — HTTP 403 Forbidden (HTTP)4031020 — Cloudflare Error 1020: Access Denied (Cloudflare)1020bind() failed (98: Address already in use) — nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) (Linux)bind() failed (98: …499 Client Closed Request / client prematurely closed connection — Nginx: [info] client prematurely closed connection while reading response header from upstream / access log status 499 (Nginx / Apache)499 Client Closed R…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-regexp523 — Cloudflare Error 523: Origin is unreachable (Cloudflare)523530 — Cloudflare HTTP 530 (with Error 1016 Origin DNS error / 1033 tunnel error) (Cloudflare)5301000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)1000

Directly related (12)

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.

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.

connect() to unix:/run/php/php-fpm.sock failed (13: Permission denied)Nginx / Apache

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.

AH00898: Error reading from remote server (502 Proxy Error)Nginx / Apache

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.

AH01114: HTTP: failed to make connection to backendNginx / Apache

Apache: [proxy:error] AH00957: HTTP: attempt to connect to 127.0.0.1:3000 (127.0.0.1) failed / AH01114: HTTP: failed to make connection to backend: 127.0.0.1

mod_proxy couldn't connect to the backend address, so the client gets 503/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.

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.

ModSecurity: Access denied with code 403Nginx / Apache

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.

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.

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 (30)

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.

upstream timed outNginx / Apache

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.

cURL error 6PHP

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

PHP cURL couldn’t resolve the hostname via DNS.

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.

Temporary failure in name resolutionLinux

ping: google.com: Temporary failure in name resolution

The Linux host can’t resolve domain names — no working DNS server is configured or reachable.

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: bind() to 0.0.0.0:80 failed (13: Permission denied)Nginx / Apache

Nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

Nginx isn't allowed to bind that port — a privileged port as non-root, or SELinux restricts it.

417HTTP

HTTP 417 Expectation Failed

The server or a proxy can’t meet the Expect header in the request — almost always Expect: 100-continue.

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.

AH00558Nginx / Apache

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.

503HTTP

HTTP 503 Service Unavailable

The server is temporarily unable to handle the request — overloaded, in maintenance, or has no healthy backends.

AH00526: Syntax error on line of apache configNginx / Apache

Apache: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/site.conf: Invalid command 'Foo', perhaps misspelled or defined by a module not included in the server configuration

Apache's config has a syntax problem or a directive from a module that isn't loaded.

AH00015: Unable to open logsNginx / Apache

Apache: AH00091: apache2: could not open error log file /var/log/apache2/error.log. AH00015: Unable to open logs (Permission denied)

Apache can't open its log files — permissions, a missing directory or disk problems.

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.

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…

upstream sent too big header while reading response headerNginx / Apache

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.

403HTTP

HTTP 403 Forbidden

The server understood the request but refuses to authorize it — you (or the server process) are not allowed to access this resour…

1020Cloudflare

Cloudflare Error 1020: Access Denied

A Cloudflare firewall/WAF custom rule blocked the request — the visitor’s IP, country, user agent or request pattern matched a bl…

bind() failed (98: Address already in use)Linux

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Nginx (or another server) can’t listen on the port because another process already holds it — often Apache, another Nginx, or a s…

499 Client Closed Request / client prematurely closed connectionNginx / Apache

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.

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?'.

523Cloudflare

Cloudflare Error 523: Origin is unreachable

Cloudflare can’t find a network route to your origin server — the DNS record points to a wrong/unroutable IP or the origin networ…

530Cloudflare

Cloudflare HTTP 530 (with Error 1016 Origin DNS error / 1033 tunnel error)

Cloudflare returns 530 together with a 1xxx error; the 1xxx code (usually 1016 or 1033) tells you the real cause.

1000Cloudflare

Cloudflare Error 1000: DNS points to prohibited IP

A proxied DNS record points at a Cloudflare IP address, creating a loop.