nginx+upload progress

next40 nginx-forum на nginx.us
Вт Дек 27 07:04:37 UTC 2011


Переделал конфиг:
	server {

		listen *:80 default;
		server_name portal.nit-energo.ru;	
		access_log /var/log/nginx/localhost.access_log main;
		error_log /var/log/nginx/localhost.error_log debug;
		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;
   }
location @script {
   rewrite ^ /upload.php last;
}
        location ^~ /progress {
	     #upload_progress_json_output;
            report_uploads uploads;
        }

 location /upload {
      # Pass altered request body to this location
      upload_pass   @script;
  
      # Store files to this directory
      # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9
should exist
      upload_store /tmp 1;
  
      # Allow uploaded files to be read only by user
      upload_store_access user:rw group:rw all:rw;
  
      # Set specified fields in request body
      upload_set_form_field $upload_field_name.name
"$upload_file_name";
      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.sha1"
"$upload_file_sha1";
      upload_aggregate_form_field "$upload_field_name.size"
"$upload_file_size";
  
      # This directive specifies any extra POST fields which should be
passed along.
      #upload_pass_form_field "^fallback$|^login$|^usession$";
  upload_pass_form_field "^X-Progress-ID$|^submit$|^email$";
      upload_cleanup 400 404 499 500-505;
  
      track_uploads uploads 5s;
    }

location /status {
    stub_status on;
    access_log  off;
    #allow xx.xx.xx.xx;
    #deny all;

  }
}

access_log:
192.168.91.192 - - [27/Dec/2011:00:42:40 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:41 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:42 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:43 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:44 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:45 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:46 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:47 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:48 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:49 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:50 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:51 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:52 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:53 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:54 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:55 +0400] "POST
/progress?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 405
778 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.63 Safari/535.7" "-"
192.168.91.192 - - [27/Dec/2011:00:42:56 +0400] "POST
/upload?X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0" 200 144
"http://10.77.88.243/upl.html" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7"
"-"

405 not allowed =(((



Лог ошибок(debug)
2011/12/27 00:42:39 [debug] 8984#0: *1 test location: "/status"
2011/12/27 00:42:39 [debug] 8984#0: *1 test location: "/upload"
2011/12/27 00:42:39 [debug] 8984#0: *1 test location: ~ "\.php$"
2011/12/27 00:42:39 [debug] 8984#0: *1 using configuration "/upload"
2011/12/27 00:42:39 [debug] 8984#0: *1 http cl:3866844 max:104857600
2011/12/27 00:42:39 [debug] 8984#0: *1 rewrite phase: 3
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: get_tracking_id
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: get_tracking_id
no header found
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: get_tracking_id
no header found, args found
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: get_tracking_id
found args: X-Progress-ID=a16a7888c2526e8337af74f39d69b340 HTTP/1.0
Host
2011/12/27 00:42:39 [debug] 8984#0: *1 malloc: 08129160:8
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: get_tracking_id
found args: a16a7888c2526e8337af74f39d69b340
2011/12/27 00:42:39 [debug] 8984#0: *1 trackuploads id found:
a16a7888c2526e8337af74f39d69b340
2011/12/27 00:42:39 [debug] 8984#0: *1 trackuploads hash 8DEAE83C for
id: a16a7888c2526e8337af74f39d69b340
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: find_node
a16a7888c2526e8337af74f39d69b340
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress: can't find node
2011/12/27 00:42:39 [debug] 8984#0: *1 add cleanup: 080FFB0C
2011/12/27 00:42:39 [debug] 8984#0: *1 trackuploads: 8DEAE83C inserted
in rbtree
2011/12/27 00:42:39 [debug] 8984#0: *1 rewrite phase: 4
2011/12/27 00:42:39 [debug] 8984#0: *1 post rewrite phase: 5
2011/12/27 00:42:39 [debug] 8984#0: *1 generic phase: 6
2011/12/27 00:42:39 [debug] 8984#0: *1 generic phase: 7
2011/12/27 00:42:39 [debug] 8984#0: *1 generic phase: 8
2011/12/27 00:42:39 [debug] 8984#0: *1 access phase: 9
2011/12/27 00:42:39 [debug] 8984#0: *1 access phase: 10
2011/12/27 00:42:39 [debug] 8984#0: *1 post access phase: 11
2011/12/27 00:42:39 [debug] 8984#0: *1 upload-progress:
ngx_http_uploadprogress_content_handler
2011/12/27 00:42:39 [debug] 8984#0: *1 malloc: 08158AC8:4096
2011/12/27 00:42:39 [debug] 8984#0: *1 http client request body preread
203
2011/12/27 00:42:39 [debug] 8984#0: *1 malloc: 08100528:8192
2011/12/27 00:42:39 [debug] 8984#0: *1 http read client request body
2011/12/27 00:42:39 [debug] 8984#0: *1 recv: fd:8 316 of 8192
2011/12/27 00:42:39 [debug] 8984#0: *1 http client request body recv
316
2011/12/27 00:42:39 [debug] 8984#0: *1 http client request body rest
3866325
2011/12/27 00:42:39 [debug] 8984#0: *1 recv: fd:8 -1 of 7876
2011/12/27 00:42:39 [debug] 8984#0: *1 recv() not ready (11: Resource
temporarily unavailable)



1. файл нормально загружаетс в /tmp/x/
2. php не перемещает файл в нужную
директорию
3. нет индикации нагрузки

В чем может быть проблема.....??? незнаю
даже куда копать
Может что-то не так настроил

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,220460,220516#msg-220516



Подробная информация о списке рассылки nginx-ru