Welcome! Log In Create A New Profile

Advanced

upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked”

September 05, 2023 04:05AM
After upgrading nginx from *1.18* to *1.24* we are getting following error:

upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked" while reading response header from upstream, client: 54.xx.xx.xx, server: backend.example.com, request: "POST /test/file HTTP/1.1", upstream: "http://10.0.xx.xx:6067/test/file", host: "backend.example.com", referrer: "https://app.example.com/

Nginx version: nginx/1.24.0

OS Version: Ubuntu 22.04.3 LTS

backend.conf

server {
access_log /var/log/nginx/access.log;
index index.html index.htm index.nginx-debian.html;
server_name backend.example.com;
include /etc/nginx/http_proxy.conf;
location /test/file {
proxy_pass http://10.0.xx.xx:6067/test/file;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host:443;
}
listen 443 ssl;
ssl_certificate /etc/backend.example.com/fullchain.pem;
ssl_certificate_key /etc/backend.example.com/privkey.pem;
include /etc/options-ssl-nginx.conf;
ssl_dhparam /etc/ssl-dhparams.pem;
}

http_proxy.conf

proxy_buffers 32 4k;
proxy_http_version 1.1;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_set_header Connection '';


The request is successfully processed at the backend(spring-boot) but we are getting above error in error.log of backend Nginx which makes frontend fail with 502

If we remove `include /etc/nginx/http_proxy.conf;` from server block
We are getting following error:

upstream sent invalid chunked response while reading upstream, client: 54.xx.xx.xx,server: backend.example.com, request: "POST /test/file HTTP/1.1”, upstream: "http://10.0.xx.xx:6067/test/file", host: "backend.example.com”, referrer: "https://app.example.com/

Let me know if some other details are required
Any help or direction to solve this issue is appriciated.
Thanks in advance.
Subject Author Posted

upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked”

snehamore204@gmail.com September 05, 2023 04:05AM

Re: upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked”

themask007 January 24, 2024 09:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 343
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready