Nginx Upload Progress Module with Rails and Passenger

故事扮演 提交于 2019-12-11 01:09:40

问题


I’ve been trying to get the Nginx upload progress module running on WebFaction with Rails and Passenger (using Paperclip to upload to S3). The best result I have come up with so far are that it reports on start and on finish, but nothing in between. The Ajax request to the /progress path is working fine.

This is the nginx.conf file I have setup: http://pastie.org/835075

Any ideas?


回答1:


What does the XHR request say midstream? If it says "starting" I solved it by changing the order of directives in the nginx.conf, though yours looks the same as mine.

Once I did that, it sent the JSON data, I found out jQuery 1.4 does not honor malformed JSON data. I added the upload_progress_json_output directive to ensure well-formed JSON.

location ^~ /progress {
  upload_progress_json_output;
  report_uploads proxied;
}


来源:https://stackoverflow.com/questions/2304848/nginx-upload-progress-module-with-rails-and-passenger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!