upload file problem (500 Internal Server Error)

magicbear nginx-forum at nginx.us
Thu Sep 1 23:17:06 UTC 2011


you can try to add such line to /etc/security/limits.conf 
nginx       soft    nofile   131072
nginx       hard    nofile  1048576


and fastcgi_pass to run PHP
you need to set SCRIPT_FILENAME, you may first include fastcgi_params at
/etc/nginx (if you install nginx with binary), and then add such line
before fastcgi_pass: fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
Piotr Polok Wrote:
-------------------------------------------------------
> On Thu, 1 Sep 2011 17:49:29 +0800, li zJay wrote:
> > try this?
> >
> >> worker_rlimit_nofile 10000;
> 
> HI,
> 
> Thank you, The 'worker_rlimit_nofile 10000' is not
> solving the problem.
> 
> I have added a 'fastcgi_pass  127.0.0.1:9000' to a
> '/upload' location 
> and now I'm getting the 'No input file specified.'
> error on html form 
> and the  '/var/log/nginx/error.log' is clear.
> 
> This is my '/upload' configuration:
> 
> ------
> location /upload {
>   #Pass altered request body to this location
>   upload_pass   @test;
> 
>   #Store files to this directory
>   #The directory is hashed, subdirectories 0 1 2 3
> 4 5 6 7 8 9 should 
> exist
>   upload_store /var/www/upload;
> 
>   #Allow uploaded files to be read only by user
>   #upload_store_access user:r;
>   upload_store_access user:rw group:rw all:r;
> 
>   #Set specified fields in request body
>   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;
> 
>   fastcgi_pass  127.0.0.1:9000;
> }
> 
> # Pass altered request body to a backend
> location @test {
>   proxy_pass   http://localhost:80;
> }
> ------
> 
> -- 
> best regards
> Piotr Polok
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214612,214639#msg-214639



More information about the nginx mailing list