Getting upload process via Nginx + Unicorn
I'm using Nginx to reverse proxy my Unicorn process for a Rails app that I have. I would like to be able to get a progress status (similar to apache-upload-progress-module) for file uploads. I tried to use NginxHttpUploadProgressModule but /pr开发者_如何学Googress still routes to the Rails app so that doesn't work. I followed the steps in NginxHttpUploadProgressModule so I'm really at a stopping point here.
Without seeing the exact configuration you implemented, nor debug log, it is difficult to understand what can be wrong.
I suggest you:
- compile nginx with the --with-debug option and activate debug log with the error_log directive.
- check the debug log for the /progress request and look the order of the tested locations.
It is well possible you are using try_files and your /progress location doesn't trigger because it is located after your catch all location. You can try to put the /progress location at the top of your server {} directive
I am using it, have a
location ^~ /progress {
upload_progress_json_output;
report_uploads proxied;
}
section in the server block and it works fine, Rails never sees /progress
.
Alright so, I figured it out with the help of both you guys (masterzen, and j-l). I didn't have
location ^~ /progress {
upload_progress_json_output;
report_uploads proxied;
}
but
location ^~ /progress {
report_uploads proxied;
}
and masterzen's comment helped also as I had
location / {
# blah blah
}
before the /progress. Thank you so much guys!!
精彩评论