500
- Standard meaning
- The server encountered an unexpected condition that prevented it from fulfilling the request
- Points to
- The server's own software, often the application behind it
5xx errors mean the server failed to handle a request. Learn what each code points to, which layer to check first, and how to troubleshoot 500, 502, 503 and 504.
A 5xx error is an HTTP status code from 500 to 599 that means the server is aware it erred or can't perform the request. It can come from your application, a proxy or load balancer, or a CDN. Read the exact code, find which layer produced it, and check that layer's logs first. Visitors can only retry or wait.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
Several machines may sit between a visitor and your code: a CDN, a load balancer, a reverse proxy, then the application. Any of them can send a 5xx, and the code is the first clue to which one did.
Is it a plain browser page, your own error template, or a CDN's branded page? Cloudflare notes that its Custom Errors can alter the appearance of its default error pages.
Run curl -I https://example.com/path and read the status line and the Server or Via headers.
If a CDN is in front, look at its error analytics. Cloudflare's dashboard lets you filter by edge status code or origin status code, based on a 1% traffic sample.
Check the load balancer, then the reverse proxy's error log, then the application log for the same timestamp.
A 504 means a gateway got no timely answer from upstream, so compare how long the request ran with the timeout settings of each hop.
curl -sI https://example.com/page | head -20For planned downtime, send a 503 with a Retry-After header, which RFC 9110 says the server MAY send to suggest how long to wait. RFC 9110 also notes that 503 doesn't oblige a server to use it when overloaded; some servers simply refuse the connection.
error_page 503 /maintenance.html;
location / {
add_header Retry-After 3600 always;
return 503;
}
location = /maintenance.html {
internal;
add_header Retry-After 3600 always;
}Cloudflare adds codes that are not in the IANA registry (it has no 520 to 526 or 530 entry). It lists them as 520 web server returns an unknown error, 521 web server is down, 522 connection timed out, 523 origin is unreachable, 524 a timeout occurred, 525 SSL handshake failed, 526 invalid SSL certificate, and 530. Pages for the ones we cover: 521, 522, 523, 524, 525, 526 and 530.
4 questions people ask next, answered from the sources on this page.
A status code from 500 to 599 meaning the server is aware that it has erred or can't perform the request. The fault is on the server side, which can include a proxy or CDN.
Reproduce it with curl, then read the application's error log for the same timestamp. A 500 means the server hit an unexpected condition, so the log usually names the exception.
Something between the visitor and your code failed: the application, a proxy or load balancer, or a CDN. The exact code tells you which kind of fault to look for.
Google says it slows crawling when it sees 5xx responses and eventually drops URLs that persistently fail.
Run the free audit, then approve the fixes. Every change can be undone.