505 HTTP Version Not Supported

HTTP 505 HTTP Version Not Supported 服务器错误响应状态码表示请求中使用的 HTTP 版本不受服务器支持。

当请求行格式不正确时,例如 GET /path to resource HTTP/1.1,或使用 \n 而不是 \r\n 终止请求行时,通常会看到此错误。例如,负载均衡器等中介可能无法处理转发请求的请求行,如下例所示。

状态

http
505 HTTP Version Not Supported

示例

由于请求行格式错误导致的 505

在以下示例中,客户端请求 example.com/dog%20trainers,但由于负载均衡器配置不正确,URL 中的百分比编码未得到正确处理。在这种情况下,源服务器看到 trainers 而不是 HTTP 版本,并返回 505 响应。响应正文中包含一个请求标识符,以说明一种可能有助于服务器管理员缩小问题根本原因范围的方法。

http
GET /dog trainers HTTP/1.1
Host: example.com
http
HTTP/1.1 505 HTTP Version Not Supported
Content-Type: text/html;
Content-Length: 123

<!doctype html>
<html lang="en">
<head>
  <title>505 HTTP Version Not Supported</title>
</head>
<body>
  <h1>505 HTTP Version Not Supported</h1>
  <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.505

另见