Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm making an ajaxed POST from jQuery, it works in development but not in production. The request doesn't show up in the rails log or the mongrel log. Nginx is returning 500, but it's not clear why the request isn't processing correctly. Any help is greatly appreciated.

2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header:
"POST /forms/5 HTTP/1.0
X-Real-IP: xx.xxx.xx.xxx
X-Forwarded-For: xx.xxx.xx.xxx
Host: www.mysite.net
Connection: close
Content-Length: 349
Cache-Control: no-cache
Origin: http://www.mysite.net
Pragma: no-cache
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.21 Safari/536.11
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://www.mysite.net/forms/5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: vsid=913vr850002167307799; __utma=1.1227253030.1337455744.1338481337.1338483703.5; __utmb=1.2.10.1338483703; __utmc=1; __utmz=1.1337455744.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

2012/05/31 13:03:21 [debug] 8633#0: *2283970 http cleanup add: 0811F054
2012/05/31 13:03:21 [debug] 8633#0: *2283970 get rr peer, try: 1
2012/05/31 13:03:21 [debug] 8633#0: *2283970 socket 5
2012/05/31 13:03:21 [debug] 8633#0: *2283970 epoll add connection: fd:5 ev:80000005
2012/05/31 13:03:21 [debug] 8633#0: *2283970 connect to 127.0.0.1:5000, fd:5 #2284004
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http upstream connect: -2
2012/05/31 13:03:21 [debug] 8633#0: *2283970 event timer add: 5: 60000:2749032482
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http request empty handler
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http upstream send request handler
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http upstream send request
2012/05/31 13:03:21 [debug] 8633#0: *2283970 chain writer buf fl:0 s:842
2012/05/31 13:03:21 [debug] 8633#0: *2283970 chain writer buf fl:0 s:235
2012/05/31 13:03:21 [debug] 8633#0: *2283970 chain writer buf fl:1 s:114
2012/05/31 13:03:21 [debug] 8633#0: *2283970 chain writer in: 0811F078
2012/05/31 13:03:21 [debug] 8633#0: *2283970 writev: 1191
2012/05/31 13:03:21 [debug] 8633#0: *2283970 chain writer out: 00000000
2012/05/31 13:03:21 [debug] 8633#0: *2283970 event timer del: 5: 2749032482
2012/05/31 13:03:21 [debug] 8633#0: *2283970 event timer add: 5: 60000:2749032483
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http upstream process header
2012/05/31 13:03:21 [debug] 8633#0: *2283970 malloc: 081172E0:4096
2012/05/31 13:03:21 [debug] 8633#0: *2283970 malloc: 080C8190:4096
2012/05/31 13:03:21 [debug] 8633#0: *2283970 recv: fd:5 359 of 4096
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy status 500 "500 Internal Server Error"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Connection: close"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Date: Thu, 31 May 2012 17:03:21 GMT"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Status: 500"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Server: Mongrel 1.1.5"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Content-Type: text/html"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header: "Content-Length: 183"
2012/05/31 13:03:21 [debug] 8633#0: *2283970 http proxy header done
2012/05/31 13:03:21 [debug] 8633#0: *2283970 HTTP/1.1 500 Internal Server Error
share|improve this question
    
It looks like nginx is failing to connect to the upstream. Check that Mongrel is actually listening on 127.0.0.1:5000 with netstat -tlpn. –  mgorven May 31 '12 at 21:23
    
I've got one entry for port 5000. tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN - I should mention, all other requests work fine, it is just this one request. –  Matt Jun 1 '12 at 2:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.