I configured nginx as reverse proxy to my node.js application for file uploads with proxy_pass directive. It works, but my problem is that nginx waits for the whole file body to be uploaded before passing it to the upstream. This causes problems for me, because I want to track upload progress at my application. Any idea how to configure nginx in order to stream file body in real time to the upstream?
相关问题
- Upload file to Google Cloud Storage using AngularJ
- How can I prevent my Shiny App from disconnecting
- Can't configure nginx as a proxy for tomcat wi
- How to set Nginx URI to fix empty URI in redirect
- codeigniter $this->upload->do_upload() = false
Tengine (a fork from nginx) support unbuffered upload by setting proxy_request_buffering to off.
http://tengine.taobao.org/document/http_core.html
Updated: in nginx 1.7.11 the proxy_request_buffering directive is available, as @Maxim Dounin mentioned above
I suspect that:
is what you need, see http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
There is no way to (at least as of now). Full request will be always buffered before nginx will start sending it to an upstream. To track uploaded files you may try upload progress module.
Update: in nginx 1.7.11 the proxy_request_buffering directive is available, which allows to disable buffering of a request body. It should be used with care though, see docs.