2 messages in ru.sysoev.nginxNginx handle of large uploads , proxy...
FromSent OnAttachments
Joe ShangNov 22, 2008 2:00 pm 
Maxim DouninNov 22, 2008 3:03 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Nginx handle of large uploads , proxy to cgi?Actions...
From:Joe Shang (joe.@gmail.com)
Date:Nov 22, 2008 2:00:19 pm
List:ru.sysoev.nginx

Very weird issue.

I am testing nginx with PHPMOTION, but there is a problem.

Its being tested on:

http://phpmotion.aptget.com/

The problem is PHPMOTION sends the upload to a cgi script, which I have set in nginx to proxy all cgi scripts to Apache itself using:

location ~ \.cgi$ { proxy_pass http://127.0.0.1:82; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

Works great, cgi works great, but when its sending a large upload, I ran an strace to the script uploading:

stat64("/home/phpmotio/public_html/temp/aaf1b8635490edaf34473de6e1cd849c/flength", 0xb7fdc900) = -1 ENOENT (No such file or directory) time(NULL) = 1227391028 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({1, 0}, {1, 0}) = 0 time(NULL) = 1227391029 stat64("/home/phpmotio/public_html/temp/aaf1b8635490edaf34473de6e1cd849c/flength", 0xb7fdc900) = -1 ENOENT (No such file or directory) time(NULL) = 1227391029 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 nanosleep({1, 0}, {1, 0}) = 0 time(NULL) = 1227391030 write(1, "Content-type: text/xml\n\n<?xml ve"..., 176) = 176 exit_group(0) = ? Process 28593 detached

Which back to the user gets the error "ERROR: Failed to find flength file" , because it couldn't find the above file, its there to show to the user the upload progress bar.

But the weird thing is Nginx is still accepting the upload in the background, so it is working, and it does everything else properly, conversion, but nginx is the one taking over the upload.

Is there a setting I can do in nginx somewhere so when uploading to via cgi, etc, to work properly as the script intended somehow?

Or is it simply that this won't work properly on Nginx?

Thanks!