ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: upload module


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: upload module
  • From: Konstantin Svist <fry.kun@xxxxxxxxx>
  • Date: Tue, 05 Apr 2011 06:59:49 -0700
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=Y3kFMQHph1M/2OFAAfOEMtS2XdQnocn/kUoX8rR962s=; b=Y6KyH3kjlU0zjbeEJFpQ4cHo32sEpYMCggviz54kvBmfaTJVJ7HNtTLtwM0n7aCrib x5QsNbw7K/n2yNe4SJMIHpNcgZ5D/Ql0fa77HB8poZV6EE7FwnFfWFryYKGMY1sbDnQN I0gqVsSM1TOX2QpgKf4lOUKEgrzvmQU36E8W0=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=kElpk/pSg4co9F6RWSPMPMLs+3ZlkzQo3VVSkElQArq+BQBFbqwPTPS58AwbyCacVR DtxQ7bb64lToSQXctO0V1y+WyIVhIt67hTBIsvB3vAkiev0B8T9Q97rrxfh74FlCUSIe 5HJGzxavYt9rM0mQm4H/BKq9QteFqRROnO5eo=
  • In-reply-to: <16761803.3042.1302004277071.JavaMail.root@xxxxxxxxxxxxxx>
  • References: <16761803.3042.1302004277071.JavaMail.root@xxxxxxxxxxxxxx>

А так даже файл не сохраняет...


On 04/05/2011 04:51 AM, Valery Kholodkov wrote:
Прошу прощения. Аргумент upload_pass не может быть абсолютным URL. Нужно 
указать локейшн или именованный локейшн.

----- Valery Kholodkov<valery+nginxru@xxxxxxxxxxx>  wrote:
Аргумент upload_pass ее может быть абсолютным URL.

----- Konstantin Svist<fry.kun@xxxxxxxxx>  wrote:
Всё никак не идёт
nginx/0.9.5

logs attached



On 03/30/2011 03:54 AM, Valery Kholodkov wrote:
Не обязаельно. Можно просто сделать дамп запроса с помощью nc.

----- Konstantin Svist<fry.kun@xxxxxxxxx>   wrote:
Пробовал с

       location @test {
           proxy_pass   http://localhost:8080;
       }


но без сервера на 8080. Там нужна живая страница чтобы начать?


On 03/29/2011 12:40 AM, Valery Kholodkov wrote:
Попробуйте без echo.

Konstantin Svist пишет:
Что-то не могу заставить upload работать.. Все время получаю "The
connection was reset"


Конфига:

server {
    listen 80;
    location /upload {
      client_max_body_size 100m;
      access_log logs/other/upload.log;
      error_log logs/other/upload_err.log;

      upload_pass @test;
      upload_store /tmp/upload 1;
      upload_store_access user:r;
      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";

      # Inform backend about hash and size of a file
      upload_aggregate_form_field "$upload_field_name.md5"
"$upload_file_md5";
      upload_aggregate_form_field "$upload_field_name.size"
"$upload_file_size";
      upload_pass_form_field "^submit$|^description$";
      upload_cleanup 400 404 499 500-505;
    }
    location @test {
      default_type text/html;
      echo "OK";
    }
    location /uploadform {
      default_type text/html;
      echo '<html><head><title>Test
upload</title></head><body><h2>Select files to upload</h2><form
name="upload" method="POST" enctype="multipart/form-data"
action="/upload"><input type="file" name="file1"><br><input
type="file" name="file2"><br><input type="submit" name="submit"
value="Upload"><input type="hidden" name="test"
value="value"></form></body></html>';
    }
}


Лога:

63.82.5.67 - - [28/Mar/2011:17:30:29 -0700] "POST /upload HTTP/1.1" 0
0 "http://testserver/uploadform"; "Mozilla/5.0 (X11; Linux i686;
rv:2.0) Gecko/20100101 Firefox/4.0"
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
--
Regards,
Valery Kholodkov

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru

server {
    listen 3480;
    error_log logs/other/err.log;
    client_max_body_size 100m;
    location / {
        default_type text/plain;
        echo "OK";
    }
    location /upload {
        upload_pass @test;
        upload_store /tmp/upload 1;
    }
    location @test {
        proxy_pass http://testserver2:2080;
    }
    location /uploadform {
        default_type text/html;
        echo '<html><head><title>Test upload</title></head><body><h2>Select 
files to upload</h2><form name="upload" method="POST" 
enctype="multipart/form-data" action="/upload"><input type="file" 
name="file1"><br><input type="file" name="file2"><br><input type="submit" 
name="submit" value="Upload"><input type="hidden" name="test" 
value="value"></form></body></html>';
    }
}
2011/04/05 06:47:07 [debug] 30272#0: *3840 accept: 173.228.88.68 fd:89
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer add: 89: 
60000:1302011287437
2011/04/05 06:47:07 [debug] 30272#0: *3840 epoll add event: fd:89 op:1 
ev:80000001
2011/04/05 06:47:07 [debug] 30272#0: *3840 post event 00007FFAF483D0B8
2011/04/05 06:47:07 [debug] 30272#0: *3840 delete posted event 00007FFAF483D0B8
2011/04/05 06:47:07 [debug] 30272#0: *3840 malloc: 0000000002BF82A0:1456
2011/04/05 06:47:07 [debug] 30272#0: *3840 posix_memalign: 0000000002DA98E0:256 
@16
2011/04/05 06:47:07 [debug] 30272#0: *3840 malloc: 000000000271D6F0:1024
2011/04/05 06:47:07 [debug] 30272#0: *3840 posix_memalign: 
0000000002A97630:4096 @16
2011/04/05 06:47:07 [debug] 30272#0: *3840 http process request line
2011/04/05 06:47:07 [debug] 30272#0: *3840 recv: fd:89 1024 of 1024
2011/04/05 06:47:07 [debug] 30272#0: *3840 http request line: "POST /upload 
HTTP/1.1"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http uri: "/upload"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http args: ""
2011/04/05 06:47:07 [debug] 30272#0: *3840 http exten: ""
2011/04/05 06:47:07 [debug] 30272#0: *3840 http process request header line
2011/04/05 06:47:07 [debug] 30272#0: *3840 posix_memalign: 
0000000002B5F940:4096 @16
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Host: testserver:3480"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "User-Agent: 
Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Accept-Language: 
en-us,en;q=0.8,ru;q=0.5,ja;q=0.3"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Accept-Encoding: gzip, 
deflate"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Accept-Charset: 
ISO-8859-1,utf-8;q=0.7,*;q=0.7"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Keep-Alive: 115"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "DNT: 1"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Connection: keep-alive"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Referer: 
http://testserver:3480/uploadform";
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Cache-Control: 
max-age=0"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Content-Type: 
multipart/form-data; 
boundary=---------------------------7294036581261141071391640722"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header: "Content-Length: 1307"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http header done
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer del: 89: 1302011287437
2011/04/05 06:47:07 [debug] 30272#0: *3840 generic phase: 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 1
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 2
2011/04/05 06:47:07 [debug] 30272#0: *3840 test location: "/"
2011/04/05 06:47:07 [debug] 30272#0: *3840 test location: "upload"
2011/04/05 06:47:07 [debug] 30272#0: *3840 using configuration "/upload"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http cl:1307 max:104857600
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 4
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 5
2011/04/05 06:47:07 [debug] 30272#0: *3840 upload-progress: get_tracking_id
2011/04/05 06:47:07 [debug] 30272#0: *3840 upload-progress: get_tracking_id no 
header found
2011/04/05 06:47:07 [debug] 30272#0: *3840 upload-progress: get_tracking_id no 
id found
2011/04/05 06:47:07 [debug] 30272#0: *3840 trackuploads no id found in POST 
upload req
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 6
2011/04/05 06:47:07 [debug] 30272#0: *3840 session handler: 
store_shm_zone=0000000000000000, store_index=-1, get_shm_zone=0000000000000000, 
get_index=-1
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 7
2011/04/05 06:47:07 [debug] 30272#0: *3840 rewrite phase: 8
2011/04/05 06:47:07 [debug] 30272#0: *3840 post rewrite phase: 9
2011/04/05 06:47:07 [debug] 30272#0: *3840 generic phase: 10
2011/04/05 06:47:07 [debug] 30272#0: *3840 generic phase: 11
2011/04/05 06:47:07 [debug] 30272#0: *3840 generic phase: 12
2011/04/05 06:47:07 [debug] 30272#0: *3840 generic phase: 13
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 14
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 15
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 16
2011/04/05 06:47:07 [debug] 30272#0: *3840 limit_access_handler: 
0000000000000000, 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 17
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 18
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 19
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 20
2011/04/05 06:47:07 [debug] 30272#0: *3840 access phase: 21
2011/04/05 06:47:07 [debug] 30272#0: *3840 post access phase: 22
2011/04/05 06:47:07 [debug] 30272#0: *3840 malloc: 0000000002999220:4096
2011/04/05 06:47:07 [debug] 30272#0: *3840 http client request body preread 448
2011/04/05 06:47:07 [debug] 30272#0: *3840 http read client request body
2011/04/05 06:47:07 [debug] 30272#0: *3840 recv: fd:89 424 of 859
2011/04/05 06:47:07 [debug] 30272#0: *3840 http client request body recv 424
2011/04/05 06:47:07 [debug] 30272#0: *3840 http client request body rest 435
2011/04/05 06:47:07 [debug] 30272#0: *3840 recv: fd:89 -1 of 435
2011/04/05 06:47:07 [debug] 30272#0: *3840 recv() not ready (11: Resource 
temporarily unavailable)
2011/04/05 06:47:07 [debug] 30272#0: *3840 http client request body recv -2
2011/04/05 06:47:07 [debug] 30272#0: *3840 http client request body rest 435
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer add: 89: 
60000:1302011287451
2011/04/05 06:47:07 [debug] 30272#0: *3840 http finalize request: -4, 
"/upload?" a:1, c:1
2011/04/05 06:47:07 [debug] 30272#0: *3840 set http keepalive handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 http close request
2011/04/05 06:47:07 [debug] 30272#0: *3840 http log handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 http full request log handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002999220
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002A97630, unused: 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002B5F940, unused: 1504
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer del: 89: 1302011287451
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer add: 89: 
65000:1302011292451
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002BF82A0
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 000000000271D6F0
2011/04/05 06:47:07 [debug] 30272#0: *3840 hc free: 0000000000000000 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 hc busy: 0000000000000000 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 tcp_nodelay
2011/04/05 06:47:07 [debug] 30272#0: *3840 post event 00007FFAF483D0B8
2011/04/05 06:47:07 [debug] 30272#0: *3840 delete posted event 00007FFAF483D0B8
2011/04/05 06:47:07 [debug] 30272#0: *3840 http keepalive handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 malloc: 000000000271D6F0:1024
2011/04/05 06:47:07 [debug] 30272#0: *3840 recv: fd:89 435 of 1024
2011/04/05 06:47:07 [debug] 30272#0: *3840 malloc: 0000000002BF82A0:1456
2011/04/05 06:47:07 [debug] 30272#0: *3840 posix_memalign: 
0000000002B5F940:4096 @16
2011/04/05 06:47:07 [debug] 30272#0: *3840 http process request line
2011/04/05 06:47:07 [info] 30272#0: *3840 client sent invalid method while 
reading client request line, client: 173.228.88.68, server: , request: 
"------------7294036581261141071391640722"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http finalize request: 400, "?" a:1, 
c:1
2011/04/05 06:47:07 [debug] 30272#0: *3840 event timer del: 89: 1302011292451
2011/04/05 06:47:07 [debug] 30272#0: *3840 http special response: 400, "?"
2011/04/05 06:47:07 [info] 30272#0: *3840 xss skipped: get_enabled disabled or 
the current method is not GET while reading client request line, client: 
173.228.88.68, server: , request: "------------7294036581261141071391640722"
2011/04/05 06:47:07 [debug] 30272#0: *3840 uploadprogress error-tracker error: 
302
2011/04/05 06:47:07 [debug] 30272#0: *3840 uploadprogress error-tracker not 
tracking in this location
2011/04/05 06:47:07 [debug] 30272#0: *3840 xslt filter header
2011/04/05 06:47:07 [debug] 30272#0: *3840 charset: "" > "utf-8"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http output filter "?"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http copy filter: "?"
2011/04/05 06:47:07 [debug] 30272#0: *3840 image filter
2011/04/05 06:47:07 [debug] 30272#0: *3840 xslt filter body
2011/04/05 06:47:07 [debug] 30272#0: *3840 http postpone filter "?" 
0000000002B60688
2011/04/05 06:47:07 [debug] 30272#0: *3840 write new buf t:0 f:0 
0000000000000000, pos 0000000000766A60, size: 108 file: 0, size: 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 write new buf t:0 f:0 
0000000000000000, pos 00000000007667C0, size: 18 file: 0, size: 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 http write filter: l:1 f:0 s:126
2011/04/05 06:47:07 [debug] 30272#0: *3840 http write filter limit 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 writev: 126
2011/04/05 06:47:07 [debug] 30272#0: *3840 http write filter 0000000000000000
2011/04/05 06:47:07 [debug] 30272#0: *3840 http copy filter: 0 "?"
2011/04/05 06:47:07 [debug] 30272#0: *3840 http finalize request: 0, "?" a:1, 
c:1
2011/04/05 06:47:07 [debug] 30272#0: *3840 http request count:1 blk:0
2011/04/05 06:47:07 [debug] 30272#0: *3840 http close request
2011/04/05 06:47:07 [debug] 30272#0: *3840 http log handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 http full request log handler
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002B5F940, unused: 632
2011/04/05 06:47:07 [debug] 30272#0: *3840 close http connection: 89
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 000000000271D6F0
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002BF82A0
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002D95ED0, unused: 0
2011/04/05 06:47:07 [debug] 30272#0: *3840 free: 0000000002DA98E0, unused: 112
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.