December 25, 2011 06:59AM
Добрый день, помогите пожалуйста разобраться с настройкой данной связки......
вопросы: файл загружает и сохраняет скрипт(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">&nbsp;</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
Subject Author Posted

nginx+upload progress

next40 December 25, 2011 06:59AM

Re: nginx+upload progress

next40 December 25, 2011 07:05AM

Re: nginx+upload progress

Andrey Repin December 25, 2011 05:36PM

Re: nginx+upload progress

next40 December 25, 2011 10:53PM

Re: nginx+upload progress

next40 December 27, 2011 02:04AM

Re: nginx+upload progress

next40 December 28, 2011 01:19AM

Re: nginx+upload progress

locojohn December 27, 2011 08:42PM

Re: nginx+upload progress

locojohn December 28, 2011 07:26AM

Re: nginx+upload progress

next40 December 28, 2011 07:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready