我已经在 Ubuntu OS 上为 rails 2.3.5 配置了带有 nginx 上传模块 + 乘客的 nginx。我正在使用 Publload(jQuery 多上传插件),但它在上传 2 或 3 个文件后挂起,但是当我从 nginx.conf 中删除 nginx 上传模块并重新启动 nginx 时,它工作正常。
这是我的 nginx.conf 文件
server {
listen 8081;
# server_name video.local;
server_name 127.0.0.1;
root /home/livia/Work/test/pulpload_rails2/public; # <--- be sure to point to 'public'!
passenger_enabled on;
client_max_body_size 1000m;
rails_env development;
location /folders/do_multiple_upload {
# pass request body to here
upload_pass @fast_upload_endpoint;
upload_store /home/livia/Work/test/pulpload_rails2/temp_files/;
upload_set_form_field asset[][original_name] "$upload_file_name";
upload_set_form_field asset[][content_type] "$upload_content_type";
upload_set_form_field asset[][filepath] "$upload_tmp_path";
# Inform backend about hash and size of a file
upload_aggregate_form_field asset[][md5] "$upload_field_name.md5" "$upload_file_md5";
upload_aggregate_form_field asset[][size] "$upload_field_name.size" "$upload_file_size";
upload_store_access user:rw group:rw all:r;
upload_pass_form_field "^submit$|^authenticity_token$|^format$|^description|^name|^id";
upload_cleanup 400 404 499 500-505;
}
location @fast_upload_endpoint {
passenger_enabled on; # or this could be your mongrel/thin backend
}
}
任何帮助都将不胜感激,因为我已经为此苦苦挣扎一个月了。