Welcome! Log In Create A New Profile

Advanced

nginx + Mono + FastCGi + AJAX

Posted by daniel_summers 
nginx + Mono + FastCGi + AJAX
January 08, 2011 12:01AM
I've been running the above combination for nearly a year, and there's always seemed to be something... off. I never could put my finger on it. Well, tonight, I figured out the problem, but I'm having a terrible time coming up with the solution. I run BlogEngine.NET on several blogs, and they've released a new version that is more reliant on AJAX POSTs. Rather than being passed on along to the FastCGI server, nginx is returning an HTTP 405 error. I found another thread here with a similar issue at http://forum.nginx.org/read.php?2,2414,4549 - this deals with proxy_pass. I'm wondering if the solution there only works for proxy_pass situations. Also, I found some information that says "Well, change the POSTs to GETs!" But, as this is a large-ish distribution package, I don't think that's a good choice.

I'm running nginx 0.8.53; here's a representative error I'm getting...
[code]127.0.0.1 - - [08/Jan/2011:04:39:24 +0000] "POST /dev/devotions/admin/AjaxHelper.aspx/LoadPosts HTTP/1.1" 405 2526 "http://johnson/dev/devotions/admin/Posts/Posts.aspx" "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.45 Safari/534.13"[/code]

I have tried every permutation of configuration suggested in the thread above, and I'm at a loss. Nothing I do will get rid of these errors. I know the code works, because when I run it with Mono's xsp2 server, everything shows up the way it should. In the past, I had a web service that I couldn't get working, and ended up proxying the requests to xsp2; however, this was a 40-day web service that was going to be running for 3 months total. IMO, that's not a good long-term solution. Any ideas?

Some attempts...
[code]location /dev/devotions {
index default.aspx;
error_page 405 = @devotions; ## One attempt
error_page 405 = $uri; ## Another attempt
if (! -e $uri) {
try_files /absent.html @devotions;
} ## Yet another attempt
## Mono FastCGI includes go here
}

location @devotions {
## Mono FastCGI includes go here
}[/code]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready