0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

NGINX - upstream sent invalid header: "\x20..." while reading response header from upstream

Last updated at Posted at 2025-02-04

Step 1.

I upgraded the NGINX version from 1.18 to 1.26.2 and then encountered an error.

upstream sent invalid header: "\x20..." while reading response header from upstream

Step 2.

I checked the NGINX CHANGE LOG and found that version 1.21.1 had relevant modifications.

Changes with nginx 1.21.1                                        06 Jul 2021

    *) Change: now nginx always returns an error for the CONNECT method.

    *) Change: now nginx always returns an error if both "Content-Length"
       and "Transfer-Encoding" header lines are present in the request.

--> *) Change: now nginx always returns an error if spaces or control
       characters are used in the request line.

--> *) Change: now nginx always returns an error if spaces or control
       characters are used in a header name.

--> *) Change: now nginx always returns an error if spaces or control
       characters are used in the "Host" request header line.

    *) Change: optimization of configuration testing when using many
       listening sockets.

    *) Bugfix: nginx did not escape """, "<", ">", "\", "^", "`", "{", "|",
       and "}" characters when proxying with changed URI.

    *) Bugfix: SSL variables might be empty when used in logs; the bug had
       appeared in 1.19.5.

    *) Bugfix: keepalive connections with gRPC backends might not be closed
       after receiving a GOAWAY frame.

    *) Bugfix: reduced memory consumption for long-lived requests when
       proxying with more than 64 buffers.

Step 3.

Then I used CURL to access the URL and found that the response header had errors.

johnny$ curl -I -k -L "https://10.10.223.223/service"
...
...
Strict-Transport-Security: max-age=31536000;       <---
        includeSubDomains                          <--- It should be one line.
...
...

REFERENCE

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?