500 內部伺服器錯誤
HTTP 的 **500 內部伺服器錯誤** 伺服器錯誤響應 狀態碼錶示伺服器遇到了意外情況,無法完成請求。此錯誤是一個通用的“catch-all”響應,用於表示伺服器無法找到更合適的 5XX 錯誤 來響應。
如果您是使用者,並在網頁上看到 500 錯誤,則這些問題需要伺服器所有者或管理員進行調查。500 錯誤有許多可能的原因,包括:伺服器配置錯誤、記憶體不足 (OOM) 問題、未捕獲的異常、檔案許可權錯誤或其他複雜因素。伺服器管理員可以主動記錄伺服器錯誤響應的發生情況,例如 500 狀態碼,以及有關發起請求的詳細資訊,以改善未來服務的穩定性。
狀態
http
500 Internal Server Error
示例
500 伺服器錯誤響應
以下請求嘗試獲取網頁,但返回 500 響應。響應主體包含一個描述伺服器狀態的頁面,其中包含指向使用者支援頁面的連結。響應主體中包含一個識別符號,用於說明可能幫助伺服器管理員縮小問題根本原因範圍的方法
http
GET /highlights HTTP/1.1
Host: example.com
User-Agent: curl/8.6.0
Accept: */*
http
HTTP/1.1 500 Internal Server Error
Content-Type: text/html;
Content-Length: 123
<!doctype html>
<html lang="en">
<head>
<title>500 Internal Server Error</title>
</head>
<body>
<h1>Internal Server Error</h1>
<p>The server was unable to complete your request. Please try again later.</p>
<p>If this problem persists, please <a href="https://example.com/support">contact support</a>.</p>
<p>Server logs contain details of this error with request ID: ABC-123.</p>
</body>
</html>
規範
| 規範 |
|---|
| HTTP 語義 # status.500 |