bitlvl
DE

HTTP-Statuscodes

Suchen Sie nach Nummer oder Wort. Die letzte Spalte ist die Situation, die den Code üblicherweise erzeugt, also das, was Sie brauchen, wenn Sie einen im Log anstarren. Die Tabelle ist auf Englisch.

 
 
CodeNameBedeutungWann man ihn sieht
100Continue
Information
The server has received the headers; send the body.After Expect: 100-continue, before uploading a large body.
101Switching Protocols
Information
The server agrees to change protocol.WebSocket handshake.
102Processing
Information
WebDAV: request accepted, still working.
103Early Hints
Information
Preliminary headers, mainly Link: rel=preload, before the final response.CDNs and Cloudflare to start loading assets early.
200OK
Erfolg
The request succeeded.The normal case.
201Created
Erfolg
A new resource was created; Location header points to it.POST to a collection in a REST API.
202Accepted
Erfolg
Accepted for processing, not finished.Async jobs and queues.
203Non-Authoritative Information
Erfolg
Response modified by a proxy.Rare.
204No Content
Erfolg
Success with nothing to return.DELETE, PUT, beacon endpoints, preflight responses.
205Reset Content
Erfolg
Success; the client should reset the form.Rare.
206Partial Content
Erfolg
Only the requested byte range is returned.Video streaming, resumable downloads (Range header).
207Multi-Status
Erfolg
WebDAV: multiple status codes in an XML body.
226IM Used
Erfolg
Delta encoding applied.Rare.
300Multiple Choices
Umleitung
Several representations are available.Rare.
301Moved Permanently
Umleitung
The resource has a new permanent URL; the browser caches the redirect. Method may change to GET.http→https, old URLs, www canonicalisation. Transfers SEO ranking.
302Found
Umleitung
Temporary redirect; method may change to GET.Post-login redirects, A/B tests. Not cached by default.
303See Other
Umleitung
Redirect to a different resource with GET.After a POST (post/redirect/get pattern).
304Not Modified
Umleitung
The cached copy is still valid; no body.Conditional requests with If-None-Match / If-Modified-Since.
307Temporary Redirect
Umleitung
Like 302 but the method and body must not change.Redirecting a POST without turning it into a GET; HSTS internal redirects in Chrome.
308Permanent Redirect
Umleitung
Like 301 but the method and body must not change.Permanent redirects of API endpoints.
400Bad Request
Client-Fehler
The request is malformed; the server will not process it.Invalid JSON, bad parameters, oversized headers, invalid Host.
401Unauthorized
Client-Fehler
Authentication is required or failed. The response should say how (WWW-Authenticate).Missing or expired token. (Should have been called Unauthenticated.)
402Payment Required
Client-Fehler
Reserved; used by some APIs for quota or billing problems.Stripe, some SaaS APIs, Cloudflare for some plan limits.
403Forbidden
Client-Fehler
Authenticated (or not) but not allowed.Permission denied, WAF block, directory listing disabled, Cloudflare challenges.
404Not Found
Client-Fehler
No resource at this URL.Typos, deleted pages, wrong routes. Should return a helpful page.
405Method Not Allowed
Client-Fehler
The URL exists but not for this method; Allow header lists the valid ones.POST to a static file, GET on a webhook endpoint.
406Not Acceptable
Client-Fehler
No representation matches the Accept headers.Rare; strict content negotiation.
407Proxy Authentication Required
Client-Fehler
Authenticate with the proxy first.Corporate proxies.
408Request Timeout
Client-Fehler
The server gave up waiting for the request.Slow clients; browsers retry silently.
409Conflict
Client-Fehler
The request conflicts with the current state.Duplicate create, version mismatch, edit collisions.
410Gone
Client-Fehler
Permanently removed, and the server knows it.Tells search engines to drop the URL faster than 404.
411Length Required
Client-Fehler
Content-Length header missing.Some servers for chunked uploads.
412Precondition Failed
Client-Fehler
An If-* condition failed.Optimistic concurrency with ETags (If-Match).
413Content Too Large
Client-Fehler
Body exceeds the limit.nginx client_max_body_size, upload limits.
414URI Too Long
Client-Fehler
The URL exceeds the limit (typically 8 KB).Huge GET query strings; use POST.
415Unsupported Media Type
Client-Fehler
The Content-Type is not supported.Sending form data where JSON is expected.
416Range Not Satisfiable
Client-Fehler
The Range header is outside the file.Broken resumable downloads.
417Expectation Failed
Client-Fehler
The Expect header cannot be met.Old proxies with Expect: 100-continue.
418I'm a teapot
Client-Fehler
April Fools RFC 2324.Easter eggs; some sites use it to reject bots.
421Misdirected Request
Client-Fehler
Sent to a server that cannot produce a response for this host.HTTP/2 connection reuse across hostnames with the wrong certificate.
422Unprocessable Content
Client-Fehler
Syntactically valid but semantically wrong.Validation errors in REST APIs (Rails, Laravel, GitHub).
423Locked
Client-Fehler
WebDAV: resource is locked.
424Failed Dependency
Client-Fehler
WebDAV: a previous request failed.
425Too Early
Client-Fehler
The server will not process a request that might be replayed (TLS 1.3 0-RTT).
426Upgrade Required
Client-Fehler
Switch to a different protocol.Forcing TLS or HTTP/2.
428Precondition Required
Client-Fehler
The request must be conditional.APIs enforcing If-Match to prevent lost updates.
429Too Many Requests
Client-Fehler
Rate limit hit; Retry-After says when to try again.API throttling, login brute-force protection, Cloudflare rate limiting.
431Request Header Fields Too Large
Client-Fehler
Headers exceed the limit.Huge cookies.
451Unavailable For Legal Reasons
Client-Fehler
Blocked by a legal demand.Geo-blocking for GDPR, court orders.
500Internal Server Error
Server-Fehler
The server hit an unexpected error.Uncaught exceptions, misconfiguration. Check the server logs, not the browser.
501Not Implemented
Server-Fehler
The server does not support the method.Rare; PATCH on old servers.
502Bad Gateway
Server-Fehler
A proxy got an invalid response from the upstream.App server crashed or not listening; nginx/HAProxy/Cloudflare in front of a dead backend.
503Service Unavailable
Server-Fehler
Temporarily unable to handle the request.Maintenance, overload, all backends down. Send Retry-After.
504Gateway Timeout
Server-Fehler
The upstream did not answer in time.Slow backend behind a proxy (proxy_read_timeout, Cloudflare’s 100 s limit).
505HTTP Version Not Supported
Server-Fehler
The HTTP version is not supported.Rare.
507Insufficient Storage
Server-Fehler
WebDAV: out of space.
508Loop Detected
Server-Fehler
WebDAV: infinite loop.
510Not Extended
Server-Fehler
Further extensions required.Rare.
511Network Authentication Required
Server-Fehler
Log in to the network first.Captive portals in hotels and airports.
520Cloudflare: Unknown Error
Cloudflare
The origin returned something Cloudflare could not interpret (empty reply, invalid headers, > 16 KB headers).Origin resets the connection or sends garbage.
521Cloudflare: Web Server Is Down
Cloudflare
Cloudflare could not connect to the origin on the port.Origin firewall blocking Cloudflare IPs, web server stopped.
522Cloudflare: Connection Timed Out
Cloudflare
TCP handshake with the origin timed out.Origin overloaded or unreachable, wrong DNS IP.
523Cloudflare: Origin Is Unreachable
Cloudflare
No route to the origin.Wrong IP in DNS, origin network down.
524Cloudflare: A Timeout Occurred
Cloudflare
TCP connected but the origin did not send a response within 100 seconds.Slow scripts, long reports, big uploads; move the work async.
525Cloudflare: SSL Handshake Failed
Cloudflare
TLS handshake with the origin failed.Full (strict) mode without a valid origin certificate, cipher mismatch.
526Cloudflare: Invalid SSL Certificate
Cloudflare
Origin certificate not trusted (Full strict).Self-signed origin cert; use a Cloudflare Origin Certificate.
530Cloudflare: Origin DNS Error / 1xxx
Cloudflare
Returned with a 1xxx error code in the body.Tunnel down, DNS error, bans.

Die Ergebnisse und Meldungen dieses Tools werden auf Englisch angezeigt.

Die fünf Klassen

1xx Information, außerhalb von Protokoll-Upgrades selten zu sehen. 2xx Erfolg. 3xx Umleitung: Der Client muss woanders suchen. 4xx Der Client hat etwas falsch gemacht (oder darf nicht). 5xx Der Server ist gescheitert. Ein Browser oder Client, der auf einen unbekannten Code trifft, behandelt ihn wie den x00 seiner Klasse, sodass neue Codes sanft degradieren.

Paare, die verwechselt werden

  • 301 vs 302 vs 307/308: 301 und 308 sind dauerhaft (gecacht, und Suchmaschinen übertragen das Ranking); 302 und 307 sind temporär. Die 7/8-Varianten verbieten das Ändern der Methode, sodass ein POST ein POST bleibt; 301/302 lassen den Browser ein GET daraus machen. Nutzen Sie 308 für dauerhafte API-Umzüge, 301 für Webseiten, 303 nach einem Formular-POST.
  • 401 vs 403: 401 heißt „wer bist du?“ (fehlende oder falsche Zugangsdaten; mit Authentifizierung wiederholen). 403 heißt „ich weiß, wer du bist, und die Antwort ist nein“. 404 statt 403 zurückzugeben ist legitim, wenn Sie nicht verraten wollen, dass die Ressource existiert.
  • 502 vs 503 vs 504: Alle kommen von einem Proxy vor Ihrer Anwendung. 502: Das Backend antwortete mit Müll oder schloss die Verbindung (abgestürzt, falscher Port). 503: nichts verfügbar (Wartung, alle Backends down, überlastet). 504: Das Backend brauchte zu lange. Cloudflares 52x-Codes verfeinern diese weiter.
  • 400 vs 422: 400 für eine Anfrage, die der Server gar nicht parsen kann; 422 für eine, die er geparst hat, aber bei der Validierung ablehnt. Viele APIs nutzen 400 für beides.

Cloudflare 52x

Cloudflare fügt eigene Codes für Probleme zwischen seinem Edge und Ihrem Origin hinzu. 521 heißt, es konnte keine TCP-Verbindung öffnen (Firewall, Server down), 522 die Verbindung lief in ein Timeout (falsche IP, überlastet), 524 die Verbindung stand, aber der Origin antwortete nicht innerhalb von 100 Sekunden, 525/526 TLS-Probleme mit dem Origin-Zertifikat (auf Full strict mit einem Origin-Zertifikat wechseln, oder auf Flexible). Sie zeigen immer auf Ihren Server oder den Weg dorthin, nie auf den Besucher.

Fragen

Was ist der Unterschied zwischen 404 und 410?

404 sagt, hier ist jetzt nichts; 410 sagt, es war hier und wurde absichtlich entfernt. Suchmaschinen werfen eine 410-URL schneller raus. Nutzen Sie 410 für gelöschte Inhalte, die Sie nicht wiederherstellen.

Soll eine API 200 mit einem Fehler im Body zurückgeben?

Nein. Clients, Proxys, Caches und Monitoring richten sich alle nach dem Statuscode. Nutzen Sie 4xx für Client-Fehler und 5xx für Server-Fehler, mit Details im Body (RFC 9457 problem+json ist die Standardform).

Warum bekomme ich 502 von nginx?

nginx konnte keine gültige Antwort vom Upstream bekommen: Die App läuft nicht, lauscht auf einem anderen Port oder Socket, ist mitten in der Anfrage abgestürzt oder hat Header gesendet, die nginx ablehnt. Prüfen Sie die Logs der App und das Fehlerlog von nginx, nicht den Browser.

Was bedeutet 429 und was soll ich tun?

Zu viele Anfragen: Sie haben ein Ratenlimit erreicht. Warten Sie die Zeit im Retry-After-Header ab und wiederholen Sie mit Backoff. Bei APIs verteilen Sie Aufrufe oder beantragen ein höheres Kontingent.