Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

Linux Server / Networking, SSH & Web Services

Separate an NGINX 502 from a failing backend

A proxy can be healthy while its upstream is down, misaddressed or using a different protocol. Test the intended local backend without client credentials.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux server baseline · Ubuntu 24.04 LTS / RHEL 9-style systems. Use the specified distribution, init system and installed tool; service names, privileges and supported options can differ.

Start with this check

Confirm the host, shell and access role. Replace sample names, paths, domains and interfaces with approved targets. These are diagnostic commands; assess policy and workload impact before making changes.

curl --connect-timeout 3 --max-time 10 -I http://127.0.0.1:8080/health

Read the result

The example performs a bounded HEAD request against an illustrative backend. HEAD may be unsupported and a localhost test does not reproduce every proxy header or namespace.

Resolve and verify

Compare NGINX's exact upstream error with the backend listener, health contract and service logs. Repair the demonstrated dependency and retest through the proxy.

Before changing production

Do not expose the backend publicly or disable TLS checks to make a 502 disappear.

Share this article

Back to all articles