Plainnotes

Responses compressed twice

2026-04-15 · 2 min readDeploy

Downloads fail with ERR_CONTENT_DECODING_FAILED, or the capture shows a duplicated Content-Encoding: gzip while the body is plain text.

Upstream — Node, a Python app, another nginx — already compressed, and the reverse proxy compressed again based on Content-Type. Compressing already-compressed bytes breaks the semantics.

Either disable compression upstream and let the edge do it, or skip responses that already carry Content-Encoding. The simplest is proxy_set_header Accept-Encoding ""; so upstream sends plain bytes; the cost is more origin traffic, which rarely matters inside a network.