Member-only story
Fixing the NGINX Error: upstream sent duplicate header line: "Transfer-Encoding: chunked"
After a recent update to the NGINX Ingress Controller, you might encounter the following error in your logs:
upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked"
This article explains what causes the issue, why it started appearing after a Helm chart upgrade, and how to fix it in a Kubernetes environment using the NGINX Ingress Controller.
Understanding the Error
This message comes from NGINX itself and indicates that the upstream service (your backend) sent the same HTTP header Transfer-Encoding: chunked
more than once. This violates the HTTP/1.1 specification, which requires headers to be unique unless explicitly defined otherwise.
NGINX, starting from version 1.25.0, has become more strict in its header handling, and as a result, now logs this behavior as an error and responds with a 502 Bad Gateway
.
When It Started Happening ???
This issue typically appears after upgrading to:
- NGINX Ingress Controller v1.10.0
- Helm chart version 4.10.0