Bad Gateway
A server in the middle, like a load balancer, reverse proxy or CDN, tried to pass your request on to the server behind it and got back something it couldn't use. Either the upstream server didn't answer properly, or the connection closed before a full response came back.
So the proxy is up, and the thing behind it isn't working. That's the useful part of a 502: it tells you where to look.
What we see on Larm
Failed HTTP checks on Larm from 9 October to 8 November 2026, across about 130 monitors.
36 of the roughly 130 HTTP monitors on Larm got at least one 502 in this period. No other status code hit as many monitors. Next were 503 (19 monitors) and 500 (12). The median time to first byte on a 502 was 311 ms, so most came back quickly. That usually means the app refused or dropped the connection rather than hanging. If the proxy had given up waiting, you'd normally see a 504 instead.
COMMON CAUSES
HOW TO FIX IT
connect() failed (111: Connection refused) or upstream prematurely closed connectionWhat this means for monitoring
A single 502 from one location is often a restart that's over a few seconds later. A 502 that lasts across several checks and locations means the app is down behind a proxy that's still working. Larm only marks a monitor down when a majority of probes see the failure and it lasts past the confirmation window, so short restarts don't page you.
Related status codes
5xx Server Error
Something went wrong on the server and it has nothing more specific to say. It's what most frameworks return when your code throws an exception it doesn't handle.
The server is up but can't handle the request right now. It's meant to be temporary: overload, maintenance, or an app that isn't ready yet.
A proxy or load balancer forwarded your request and gave up waiting for the server behind it to answer.
Cloudflare-specific. Cloudflare connected to your origin server and got a response it couldn't use, or no response at all.
Cloudflare-specific. Cloudflare tried to connect to your origin server and the connection was refused.
Cloudflare-specific. Cloudflare tried to connect to your origin and the connection timed out.
Cloudflare-specific. Cloudflare can't find a network route to your origin server.
Cloudflare-specific. Cloudflare connected to your origin but couldn't complete the TLS handshake with it.
Cloudflare-specific. Cloudflare couldn't find where to send the request: it couldn't resolve the origin's hostname, or the Cloudflare Tunnel for it isn't connected.
Get alerted when your endpoints return unexpected status codes.
Larm checks your HTTP endpoints from multiple global locations and alerts you when they return status codes outside your expected range.