nginx+upload progress
next40
nginx-forum на nginx.us
Вс Дек 25 11:59:48 UTC 2011
Добрый день, помогите пожалуйста
разобраться с настройкой данной
связки......
вопросы: файл загружает и сохраняет
скрипт(php) или сам nginx?
не пойму как правильно настроить.....
OS Gentoo Linux
nginx/1.0.10(собран с поддержкой upload module и
uploadprogress module)+php5.3(c поддержкой
pecl-uploadprogress)
использую скрипт на ajax для теста, вот
форма:
<form id="upload" enctype="multipart/form-data" action="/upload"
method="post">
<input name="file" type="file"/>
<input type="submit" value="Upload"/>
</form>
<div id="uploading">
<div id="progress" class="bar">
<div id="progressbar"> </div>
</div>
</div>
<div id="percents"></div>
Конфиг nginx:
server {
listen *:80 default;
server_name uploads;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
root /var/www/localhost/htdocs;
charset windows-1251;
location ~ \.php$ {
fastcgi_connect_timeout 90;
fastcgi_send_timeout 60;
fastcgi_read_timeout 120;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
upload_store /tmp 1;
upload_set_form_field "${upload_field_name}_name"
"$upload_file_name";
upload_set_form_field "${upload_field_name}_content_type"
"$upload_content_type";
upload_set_form_field "${upload_field_name}_path"
"$upload_tmp_path";
upload_pass_form_field "^submit$";
location = /upload {
upload_pass /internal_upload;
track_uploads proxied 30s;
}
location ^~ /progress {
# report uploads tracked in the 'proxied' zone
report_uploads proxied;
}
}
}
Результат:
405 Not Allowed
В логах:
2011/12/25 16:16:49 [error] 28776#0: *59 failed to create output file
"/tmp/0/0000000010" for "FW_TEW-652BRP_V1(1.10b08).zip" (2: No such file
or directory), client: 192.168.91.190, server: uploads, request: "POST
/upload?X-Progress-ID=e23800c2a6644532b847d983f6adfb2d HTTP/1.0", host:
"10.77.88.243", referrer: "http://10.77.88.243/upload.html"
2011/12/25 16:17:05 [info] 28776#0: *61 client closed prematurely
connection while reading client request line, client: 192.168.91.190,
server: uploads
Posted at Nginx Forum: http://forum.nginx.org/read.php?21,220460,220460#msg-220460
Подробная информация о списке рассылки nginx-ru