500Status code
5xxServer error
NoCacheable by default
RFC 9110 §15.6.1Defined in
Common causes
- Unhandled exception in application code
- Syntax error in config such as .htaccess
- Database connection failure
What to do
Check the server error log; the browser side cannot fix it. Never show stack traces to users in production.
Example response
HTTP/1.1 500 Internal Server Error
Content-Type: application/problem+json
{"status":500,"title":"Internal Server Error"}
Returning 500 in code
Express res.status(500).json({ … });
Flask return jsonify(…), 500
PHP http_response_code(500);
Go w.WriteHeader(500)
nginx return 500;