HTTP 500 Internal Server Error Status Code

5xx Server Error · RFC 9110 §15.6.1 · Unexpected unhandled exception inside the origin application

500 Internal Server Error RFC 9110 §15.6.1
Open /500/ →
Response & Header Builder
1m
max-age: 0s (immediate)
Editable Response Body
Live Raw HTTP Response 7 headers · 205 bytes
HTTP/1.1 500 Internal Server Error
Date: Tue, 24 Nov 2026 12:00:00 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 205
Cache-Control: no-store
Content-Type: application/problem+json; charset=utf-8
X-Request-Id: req_01J9X8Z1K4
X-Content-Type-Options: nosniff

{"type":"https://bytehelpers.com/http-status/500/","title":"Internal Server Error","status":500,"detail":"An unexpected error occurred. Quote trace_id when contacting support.","trace_id":"req_01J9X8Z1K4"}
location /api/example {
    add_header Cache-Control "no-store" always;
    add_header X-Request-Id "req_01J9X8Z1K4" always;
    add_header X-Content-Type-Options "nosniff" always;
    default_type application/json;
    return 500 '{"type":"https://bytehelpers.com/http-status/500/","title":"Internal Server Error","status":500,"detail":"An unexpected error occurred. Quote trace_id when contacting support.","trace_id":"req_01J9X8Z1K4"}';
}
Pairwise HTTP Confusion Comparator
Open /http-status/502/ →
Attribute 500 Internal Server Error 502 Bad Gateway
Status & Phrase500 Internal Server Error502 Bad Gateway
Category5xx Server Error5xx Server Error
SpecificationRFC 9110 §15.6.1RFC 9110 §15.6.3
Core SemanticsIndicates that the origin server encountered an unexpected internal condition or unhandled exception that prevented it from fulfilling the request.A gateway or reverse proxy (Nginx, ALB, Cloudflare) received an invalid, truncated, or refused response from the upstream server.
Cacheable by DefaultNoNo
Method PreservationN/AN/A
Safe to Auto-RetryNo (fix request first)Yes (with backoff)
Response Body AllowedYesYes
Key HeadersCache-Control, Content-Type, X-Request-IdCache-Control
HTTP 500 Internal Server Error Content-Length: 205 B Non-cacheable · Non-retryable
Ctrl+Enter: Copy Raw · 100% Browser-Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

Triaging HTTP 500 Internal Server Errors Without Leaking Secrets

HTTP 500 Internal Server Error is the catch-all 5xx response emitted when the origin application itself crashes or hits an unhandled exception. Unlike 502 Bad Gateway (upstream unreachable/invalid) or 504 Gateway Timeout (upstream hung), a 500 tells your on-call team that traffic reached the application code successfully and blew up inside it—making application error logs, Sentry traces, and recent deployments the first place to inspect.

Never serialize raw stack traces, database table names, or environment details into production 500 payloads (OWASP Information Exposure). Instead, generate a unique X-Request-Id / trace_id at the ingress layer, log the full stack trace internally keyed by that ID, and return a clean RFC 9457 application/problem+json envelope containing only the opaque trace_id.

  • RFC SpecificationRFC 9110 §15.6.1 (Server Error 5xx)
  • Security RuleStrip stack traces & SQL errors; expose only an opaque trace_id
  • Cacheable / RetryableNot cacheable · Retry only cautiously on idempotent GET/PUT
How do I tell the difference between 500, 502, 503, and 504 during an outage?

500 = app code crashed internally; 502 = reverse proxy got an invalid/broken response from upstream; 503 = server overloaded or in maintenance; 504 = upstream failed to respond before proxy timeout.

Should HTTP clients automatically retry a 500 Internal Server Error?

Only with extreme caution on strictly idempotent GET/HEAD requests (1–2 backoff retries). Never blindly retry non-idempotent POST 500s unless you send an Idempotency-Key, as the mutation may have already committed before crashing.

Why should bad user input never trigger HTTP 500?

Letting malformed client input throw unhandled 500s pollutes server SLA/SLO error budgets and wakes on-call engineers for client bugs that belong in 400 or 422.