Upload module can not upload file (Permission denied)

Yanxin Z. lists at ruby-forum.com
Tue Mar 29 00:25:30 MSD 2011


Thank you for your help.

I changed chmod 777 for /tmp. The access issue is solved.
However, I encountered another problem.

 82 2011/03/28 13:19:11 [notice] 17231#0: start worker process 17232
 83 2011/03/28 13:19:20 [error] 17232#0: *1 connect() failed (111: 
Connection refused) while connecting to            upstream, client: 
127.0.0.1, server: , request: "POST /upload HTTP/1.1", upstream: 
"http://127.0.0.1:8080/        upload", host: "127.0.0.1", referrer: 
"http://127.0.0.1/"


My configure file is here:
  1 worker_processes 1;
  2
  3 error_log logs/error.log notice;
  4
  5 working_directory /opt/nginx;
  6
  7 events {
  8     worker_connections 1024;
  9 }
 10
 11 http {
 12     include mime.types;
 13     default_type application/octet-stream;
 14

 15     server {
 16         listen 80;
 17         client_max_body_size 100m;
 18
 19         location / {
 20             root    html;
 21             index   index.html;
 22         }
 23
 24         # Upload form should be submitted to this location
 25         location /upload {
 26             # Pass altered request body to this location
 27             upload_pass @test;
 28
 29             # Store files to this directory
 30             # The directory is hashed, subdirectories 0 1 2 3 4 5 6 
7 8 9 should exist
 31             upload_store /tmp;
 32
 33             # Allow uploaded files to be read only by user
 34             upload_store_access user:rw group:rw all:rw;
 35
 36             # Set specified fields in request body
 37             upload_set_form_field "${upload_field_name}_name" 
$upload_file_name;
 38             upload_set_form_field 
"${upload_field_name}_content_type" $upload_content_type;
 39             upload_set_form_field "${upload_field_name}_path" 
$upload_tmp_path;
 40
 41             # Inform backend about hash and size of a file
 42             upload_aggregate_form_field "${upload_field_name}_md5" 
$upload_file_md5;
 43             upload_aggregate_form_field "${upload_field_name}_size" 
$upload_file_size;
 44
 45             upload_pass_form_field "^submit$|^description$";
 46             upload_cleanup 400 404 499 500-505;
 47         }
 48
 49         # Pass altered request body to a backend
 50         location @test {
 51             #passenger_enabled on;
 52             proxy_pass http://localhost:8080;
 53             proxy_temp_path /home/virus/tmp/proxy_temp;
 54         }
 55     }
 56 }

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list