Welcome! Log In Create A New Profile

Advanced

Disabling request body buffering for an app running in a container

Posted by mmehdi_rajaee 
Disabling request body buffering for an app running in a container
December 28, 2021 11:57PM
I have Nginx 1.18 (not dockerized) to host a REST API application (running in a Docker Container) on Ubuntu 20.04, and I try to set proxy_request_buffering off to allow uploading large files with streaming. Here it is my server blocks:

server {
server_name mydomain;
location ~ ^/(api|static\-data|static\-files)/ {
proxy_pass http://127.0.0.1:5001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
proxy_request_buffering off;
client_max_body_size 1000m;
client_body_buffer_size 1000m;
}
}

But it does not work for me.

Beside upload API, I have another API to show the progress. When upload API is in pending state, the response of the progress API reveals that my application does not receive the upload request until the file is fully buffered by Nginx. So my back-end application receives files completely, and in the client side, the progress bar displays zero percent until the entire file is uploaded.

By the way, anything is OK when I test locally with Kestrel. Any ideas?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 96
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