← Blog

500, 502, 503, 504: What Those HTTP Errors Mean and How to Fix Them

Jul 6, 2026

When a page returns a 5xx error, the server received your request but couldn't fulfill it. Unlike a 404 (page not found), these point to a problem on the server side. Here's what the four most common ones mean and how to resolve them.

500 Internal Server Error

The catch-all. The server hit an unexpected condition and couldn't complete the request — usually an application crash.

Common causes: a bug in the code, an unhandled exception, a bad database query, wrong file permissions, or a broken configuration file after a deploy.

How to fix it (site owners): check your application and server error logs — the real reason is almost always there. Pushed a recent deploy? Roll it back and confirm the error clears.

As a visitor: refresh in a minute; if it persists, it's their problem to fix, not yours.

502 Bad Gateway

One server acting as a gateway or proxy received an invalid response from the upstream server it depends on.

Common causes: the backend application is down or crashed, a PHP or Node process died, or a firewall is blocking the connection between the proxy and the app.

How to fix it: confirm the upstream service (your app server, PHP-FPM, etc.) is actually running. Restart it if it crashed, and check that the proxy — Nginx, a load balancer, or a CDN like Cloudflare — can reach it.

503 Service Unavailable

The server is up but temporarily can't handle the request — either on purpose or under strain.

Common causes: the server is overloaded, a process pool is exhausted, or the site is in maintenance mode.

How to fix it: if it's traffic, add capacity or caching. If it's maintenance, keep it brief and make sure your status page and monitoring reflect the planned window, so you don't alarm users or page yourself needlessly.

504 Gateway Timeout

Like a 502, but instead of a bad response the upstream server took too long and the gateway gave up waiting.

Common causes: a slow database query, a long-running request, or an overloaded backend that can't respond within the timeout.

How to fix it: find what's slow. A single heavy query or a stuck external API call is the usual culprit. Our post on good server response times covers how to track and cut this down.

The pattern behind all four

Every one of these means your server answered but something behind it failed — and every one is invisible to you until someone notices. That "someone" should be a monitor, not a customer.

A keyword check is especially useful here: it doesn't just confirm the server responds, it confirms the page contains the text it should — so a 500 error page or a blank 503 gets flagged as down, not up.

Set up free monitoring with SiteIsOnline and get alerted the moment your site returns a 5xx error — or check a URL right now with the website down checker.


Monitor your site free. Get instant alerts the moment your website goes down, plus a public status page. Start free