<div dir="ltr">Hello all,<div><br></div><div>I've configured nginx as a load balancing proxy for my backend servers. My backend is expecting multi-part uploads for large files in small chunks (5-15mb). The issue I'm encountering, is that I would like for nginx to just pass the chunked data along to the backend servers and not buffer the requests.</div>
<div><br></div><div>Current configuration:</div><div><br></div><div><div>upstream riak-cs {</div><div> server <a href="http://192.168.1.19:8080">192.168.1.19:8080</a>;</div><div> server <a href="http://192.168.1.22:8080">192.168.1.22:8080</a>;</div>
<div> #least_conn;</div><div>}</div><div><br></div><div>server {</div><div> listen 80;</div><div> server_name <a href="http://cs.domain.com">cs.domain.com</a> *.<a href="http://cs.domain.com">cs.domain.com</a>;</div>
<div> location / {</div><div> proxy_pass <a href="http://riak-cs">http://riak-cs</a>;</div><div> proxy_set_header Host $host;</div><div> proxy_connect_timeout 59s;</div>
<div> proxy_send_timeout 600;</div><div> proxy_read_timeout 600;</div><div> proxy_buffering off;</div><div> proxy_pass_header Server;</div><div> add_header Backend $proxy_host:$proxy_port;</div>
<div> add_header Upstream-Response-Time $upstream_response_time;</div><div><br></div><div> }</div><div><br></div><div>}</div><div><br></div><div><div>user nginx;</div><div>worker_processes 4;</div>
<div>error_log /var/log/nginx/error.log;<br></div><div>pid /var/run/nginx.pid;</div><div><br></div><div>events {</div><div> worker_connections 4096;</div><div>}</div><div><br></div><div>http {<br></div><div> include /etc/nginx/mime.types;</div>
<div> default_type application/octet-stream;</div><div><br></div><div> log_format main '$remote_addr - $remote_user [$time_local] "$request" '</div><div> '$status $body_bytes_sent "$http_referer" '</div>
<div> '"$http_user_agent" "$http_x_forwarded_for"';</div><div><br></div><div> access_log /var/log/nginx/access.log main;</div><div> sendfile on;<br></div><div>
tcp_nopush on;</div><div> tcp_nodelay on;</div><div> keepalive_requests 100;</div><div> client_max_body_size 1000M;</div><div> keepalive_timeout 3;</div><div> reset_timedout_connection on;</div>
<div> underscores_in_headers on;<br></div><div><br></div><div> include /etc/nginx/conf.d/*.conf;<br></div><div><br></div><div>}</div></div><div><br></div><div><br></div><div>I have tried disabling buffers as shown above, however, when I capture the packets on the backend servers, I see that the stream of data doesn't occur until after the full body of the upload has completed.</div>
<div><br></div><div><div>[ jedi ] ~ # nginx -v</div><div>nginx version: nginx/1.4.3</div><div><br></div><div>If I enabled info error logging, I see:<br><div>2013/11/14 22:34:47 [warn] 2698#0: *1 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 192.168.1.1, server: <a href="http://cs.domain.com">cs.domain.com</a>, request: "PUT /huge/Windows7Ultimate.iso?partNumber=1&uploadId=1RjFvAcQTsWmpnIYD7nL7Q== HTTP/1.1", host: "<a href="http://big.cs.domain.com">big.cs.domain.com</a>"</div>
<div><br></div></div></div><div>How can I prevent this all together?</div><div><br></div><div>Thanks,</div><div>Andrew</div></div><div><br></div>-- <br><div dir="ltr">[Andrew Tynefield]</div>
</div>