# HTTP 502 vs 503 vs 504

> Compare HTTP 502, 503, and 504 errors and use response context to narrow incident causes.

Canonical: https://sentryxmonitor.com/learn/networking/http-502-vs-503-vs-504/
Last updated: 2026-08-08

Networking and protocol operations

HTTP 502 means a gateway received an invalid upstream response, 503 means the service is currently unavailable, and 504 means a gateway timed out waiting for an upstream response.

Reviewed 2026-08-08 Read-only educational guidance

## Key points

- All three indicate different failure boundaries.

- The responding layer matters as much as the status code.

- Logs and timing help distinguish overload from connectivity failure.

## How does it work?

Reverse proxies and load balancers sit between clients and applications. They return gateway errors when upstream connection, response, capacity, or timeout conditions prevent a normal response.

## What can go wrong?

Generic retries can amplify overload, while monitoring only for connection failure misses these application-path outages.

## How can teams detect the problem?

Record status, response headers, latency, region, endpoint, upstream health, and whether direct origin checks differ from the public gateway.

## How can teams fix or reduce the problem?

Tune timeouts carefully, add capacity and health checks, use bounded retries with backoff, and monitor both public and internal dependencies.

## What does a technical example look like?

```
502: proxy got malformed/reset response
503: service intentionally unavailable or overloaded
504: proxy waited beyond upstream timeout
```

The example uses reserved documentation domains and addresses. Apply the same reasoning to systems you own or are authorized to assess.

## Authoritative technical references

- [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html)

## How does continuous monitoring help?

A point-in-time check explains the observed state now. [Continuous monitoring](https://sentryxmonitor.com/services/uptime-monitoring/) establishes an expected baseline, repeats the relevant check, and records meaningful state changes so an owner can investigate before a small configuration drift becomes a prolonged security or availability problem. See [Networking](https://sentryxmonitor.com/learn/networking/) for the surrounding technical context.

## Where does Sentryx Monitor fit?

Sentryx Monitor provides [read-only outside-in discovery](https://sentryxmonitor.com/services/external-attack-surface-monitoring/) and monitoring for public hosts, DNS, HTTPS, TLS certificates, baseline security headers, email-security records, and selected network services. It supports evidence and operational follow-up, but it does not replace authorized penetration testing, authenticated vulnerability assessment, or owner validation.

## Continue learning

- [Internet Networking for Security and Monitoring](https://sentryxmonitor.com/learn/networking/) - The parent networking guide.

- [What Is TCP Port Monitoring?](https://sentryxmonitor.com/learn/networking/tcp-port-monitoring/) - Learn how TCP port monitoring checks service reachability and where it differs from application monitoring.

- [Common Internet-Facing Ports Explained](https://sentryxmonitor.com/learn/networking/internet-facing-ports/) - Understand common public TCP and UDP ports and when exposure deserves review.

- [What Does Port 443 Do?](https://sentryxmonitor.com/learn/networking/port-443/) - Understand how port 443 carries HTTPS traffic and how DNS, TCP, TLS, and HTTP participate.

## Related
- [Home](https://sentryxmonitor.com/)
