Score:0

Nginx warning: client sent invalid header line: "server_port: 80" while reading client request headers

ru flag

I have an Nginx instance proxy_passing an HTTP request to an HTTPS API. These some configs like:

# 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;

But I found this error when deployed in containers. Full error looks like:

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"
in flag
That's not an error, just an info. What is your actual problem?
Richard Smith avatar
jp flag
Underscores in header names are generally not allowed. So either find out why your application is sending a header called `server_port` and change the name, or instruct the servers which receive the request to allow [underscores in headers](http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.