Upstream sent duplicate header line: \"Transfer-Encoding: chunked\

Getting error: upstream sent duplicate header line: "Transfer-Encoding: chunked\ while reading response header from upstream,

Its proxy service. Resulting in 502 NGINX error.

Can you share the nginx config that you are using? This error can be caused by a few things, but most likely it is due to the connection to the upstream using HTTP/1, but the upstream app is expecting HTTP/1.1. If you add the directive proxy_http_version 1.1; to the config where the proxy_pass is being set, that may resolve this issue.