Nginx 警告:客户端在读取客户端请求标头时发送了无效标头行:“server_port: 80”

Nginx 警告:客户端在读取客户端请求标头时发送了无效标头行:“server_port: 80”

我有一个 Nginx 实例,proxy_pass正在向 HTTPS API 发送 HTTP 请求。这些配置如下:

# some $args rewrites and headers

proxy_pass_request_headers on;
proxy_set_header Host $target_host;
proxy_pass https://my-host/api$uri$is_args$args;

但我在容器中部署时发现了这个错误。完整的错误如下:

2023/02/03 15:22:29 [info] 21#21: *40 client sent invalid header line: "server_port: 80" while reading client request headers, client: XXXXXXX, server: , request: "POST /XXXXXXX/XXXXX?XXXXXXXX=XXXX HTTP/1.1", host: "XXXXX.XXXX.com"

相关内容