Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Nginx stops sending request body when upstream server consuming body while returning data

$
0
0
Out of curiosity, I set up a minimal scenario to reproduce your effect. I put this segment into my http section of nginx.conf:

server {
listen 127.0.0.1:8080;
client_body_temp_path /tmp/nginx;
client_body_in_file_only clean;
client_body_buffer_size 1m;
client_max_body_size 0;
location = /send {
proxy_http_version 1.1;
proxy_request_buffering on;
proxy_cache off;
proxy_pass_request_body on;
proxy_pass http://127.0.0.1:8081;
proxy_buffering off;
proxy_redirect off;
}
}

Then I would set up a netcat on port 8081 to see how much would arrive there:

nc -l -o /tmp/in 8081 > /dev/null

Create a file with random data of size 30 MB:

dd if=/dev/urandom of=/tmp/bigstuff bs=1024 count=30720

After starting NGINX, run a curl to post this file:

curl -v -X PUT --data-binary "@/tmp/bigstuff" http://127.0.0.1:8080/send

You will see that the netcat shows a file of 30 MB plus around 176 bytes. That's the HTTP header.

Can you verify this with your setup?

If this should work, it rules out NGINX as the culprit not handling files of this size. There may still be something in the communication between the components. If you try curl with -d instead of --data-binary, it will hang at some point because the default is --data-ascii. If you have size limitations in Jetty or your receiving framework, you may also run into trouble.

--j.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>