Welcome! Log In Create A New Profile


Force chunk transfer enconding in NGINX for proxied responses

Posted by mainex 
Force chunk transfer enconding in NGINX for proxied responses
July 23, 2020 07:14AM
I've got an upstream that sends back responses in "applicaion/json" format. NGINX is used as a reverse proxy in my project. However, I have a hard requirement that client applications only accept the chunked encoding response. And hence somehow I need to transform my "Content-Length: XXXX" responses to "Transfer-Encoding: chunked".

Can NGINX somehow do it automatically? It is really irrelevant how chunk sizes are divided, as long as they are simply chunked. Updating client applications is unfortunately not an option, but also modifying upstream backend API would be very problematic as well. Just NGINX could help here.

I've tried playing with the following parameters in the "location" config, but in vane

prox_buffering off;
chunked_transfer_encoding on;
proxy_http_version 1.1;

Appreciate any help!

Edited 1 time(s). Last edit at 07/23/2020 07:15AM by mainex.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready