Upstream sent "Content-Length" and "Transfer-Encoding" headers at the same
July 29, 2024 09:21AM
We are upgrading from Nginx 1.22.0 to Nginx 1.24.0. We have an upstream node server that is sending both "Content-Length" and "Transfer-Encoding" headers in the response which eventually causes the client to fail with a 502 error in 1.24.0 but it works fine in 1.22.0.

Here is the access log from the node app location block:

v1.22.0:
|LOG_LINE| 29/Jul/2024:13:04:38 +0000 [presentation.access.cn_name:<session_id>: REQUEST ID=<request_id>] { uri: "/aries-presentation/", status: "200", referer: "-", request_time: 1.174, upstream_response_time: "1.162", upstream_status: "200", connection: "17106", location: "-", upstream_location_response:"-", bytes_sent: "164744", client_ip: "<client_ip>", x_dynaTrace: "<dt_id>", host: "ram-nginx-auto-green", upstream_content_length: "163919", upstream_transfer_encoding: "chunked", sent_content_length: "-", sent_transfer_encoding: "chunked"}


v1.24.0:
|LOG_LINE| 29/Jul/2024:11:47:18 +0000 [presentation.access.cn_name:<session_id>: REQUEST ID=<request_id>] { uri: "/aries-presentation/", status: "502", referer: "-", request_time: 1.485, upstream_response_time: "1.469", upstream_status: "502", connection: "162407", location: "-", upstream_location_response:"-", bytes_sent: "1536", client_ip: "<client_ip>", x_dynaTrace: "<dt_id>", host: "ram-nginx-auto-green", upstream_content_length: "164626", upstream_transfer_encoding: "chunked", sent_content_length: "-", sent_transfer_encoding: "chunked"}

We have tried putting chunked_transfer_encoding off; in the node app location block but to no avail.

Question:
1. Why the response is 502 in 1.24.0 and 200 in 1.22.0 when the node app is sending both headers in the case of 1.22.0 as well as 1.24.0?
2. What can be done to resolve the issue since putting chunked_transfer_encoding off; in the location block is not working?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 190
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready