# 上游在读取响应头时发送了 HTTP/1.0 响应，客户端：10.0.0.5

- **ID:** `nginx/upstream-sent-http-1-0-response-while-reading-response-header`
- **领域:** nginx
- **类别:** protocol_error
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

上游服务器返回 HTTP/1.0 响应，而 nginx 期望 HTTP/1.1 或 HTTP/2，导致头部解析失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| nginx 1.24.0 | active | — | — |
| nginx 1.22.1 | active | — | — |
| nginx 1.20.2 | active | — | — |

## 解决方案

1. ```
   Set 'proxy_http_version 1.1;' in the location block and ensure upstream supports HTTP/1.1. Example: location /api { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Connection ''; }
   ```
2. ```
   If upstream cannot be changed, add 'proxy_set_header Connection close;' to force connection closure after each request.
   ```

## 无效尝试

- **** — Buffer size is not the issue; the protocol version mismatch is unrelated to buffer allocation. (70% 失败率)
- **** — This forces HTTP/1.0 which may cause other issues; the real fix is to upgrade the upstream. (60% 失败率)
