500 error on multipart POST, no error log

I can’t figure this out… ( nginx/0.6.31 )

my server{} block has this

 access_log  /var/log/nginx/SITE/dev.SITE.com-access.log main;
 error_log   /var/log/nginx/SITE/dev.SITE.com-error.log ;

 location ~ "^/(_img|_css|_js)" {
             root /home/SITE/_current-web;
     }

 location ~ "^/" {
             proxy_pass   http://127.0.0.1:5001;
     }

When trying to upload an image to the ProxyPass, I get an 500
Internal Server Error … but nothing goes to the error log

the access log tells me:

24.239.177.95 - jonathan [29/Jul/2008:22:11:49 +0000] 500 “POST /
admin HTTP/1.1” 193 “http://dev.SITE.com/admin/?m=add_edit_image
“Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/
525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22” “-” “cookie
=cookie_val; cooki=cookie_val”

I’m probably doing something wrong , but there’s no error to point me
in the right direction. the site works fine locally (without nginx
proxying). there just seems to be something on the post through
NGINX that screws things up.

also to add…

The form is this:

and occurs on a page ( referrer ) with url "/admin?m= add_edit_image

there is a post that works on the same proxy with this:

and occurs on a page ( referrer ) with url “/my/photos/upload”

so the only real different is the referrer header

Check you backend log, the 500 error surely is coming from it.


Aníbal Rojas

http://anibal.rojas.com.ve

On Jul 30, 2008, at 6:40 PM, Aníbal Rojas wrote:

Check you backend log, the 500 error surely is coming from it.

That was the first thing I checked – the backend never gets the
request, let alone throws an error.

On Wed, Jul 30, 2008 at 08:40:28AM -0400, jeff emminger wrote:

Wild guess… try without the quotes? e.g. change
location ~ “^/” {
proxy_pass http://127.0.0.1:5001;
}

to
location ~ ^/ {
proxy_pass http://127.0.0.1:5001;
}

No, quotes do not effect here.

Wild guess… try without the quotes? e.g. change
location ~ “^/” {
proxy_pass http://127.0.0.1:5001;
}

to
location ~ ^/ {
proxy_pass http://127.0.0.1:5001;
}

On Tue, Jul 29, 2008 at 06:27:25PM -0400, Jonathan V. wrote:

24.239.177.95 - jonathan [29/Jul/2008:22:11:49 +0000] 500 “POST /
admin HTTP/1.1” 193 “http://dev.SITE.com/admin/?m=add_edit_image
“Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/
525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22” “-” “cookie
=cookie_val; cooki=cookie_val”

I’m probably doing something wrong , but there’s no error to point me
in the right direction. the site works fine locally (without nginx
proxying). there just seems to be something on the post through
NGINX that screws things up.

Do you see nginx’s signature in 500 error page ?

On Wed, Jul 30, 2008 at 01:40:37PM -0400, Jonathan V. wrote:


nginx/0.6.31 ---

which is why i’m questioning the lack of error logging

Then I need a debug log.

On Jul 30, 2008, at 8:53 AM, Igor S. wrote:

Do you see nginx’s signature in 500 error page ?

Yes, its an nginx error page

500 Internal Server Error

500 Internal Server Error


nginx/0.6.31 ---

which is why i’m questioning the lack of error logging

I’m cc-ing nginx list, I hope you do not mind…

On Jul 31, 2008, at 9:33 AM, Aníbal Rojas wrote:

Remove the

error_log /var/log/nginx/SITE/dev.SITE.com-error.log ;

And check if the error hits the default log.

Also check if /var/log/nginx/SITE/dev.SITE.com-error.log
has the proper permissions.

default log had proper permissions… even tried giving it 777… no
luck

however removing the error log line… and it works.

very odd – usually nginx fails a -t test if there are any issues
like that

i can’t figure out why this would happen too…

for this url / POST only…
if the error log line is there, i get a 500 error
if the error log line is not there, the page works fine but not
error message is logged anywhere

then I tried
error_log /var/log/nginx/SITE/dev.SITE.com-error.log debug ;

and it worked, and it logged to file

then i took out
error_log /var/log/nginx/SITE/dev.SITE.com-error.log ;

and it worked, but it didn’t log to file …

at the least, it seems like the default error log level has been lost…

i can’t understand why/how it was causing the 500 error