views:

901

answers:

4

We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request:

OPTIONS /index.html HTTP/1.0

I'm working with getting nginx set up as a reverse proxy with caching (using ncache). For some reason, nginx is returning a 405 when an OPTIONS request comes in:

192.168.1.10 - - [22/Oct/2008:16:36:21 -0700] "OPTIONS /index.html HTTP/1.0" 405 325 "-" "-" 192.168.1.10

When hitting the downstream webserver directly, I get a proper 200 response. My question is: how to you make nginx pass that response along to HAProxy, or, how can I set the response in the nginx.conf?

Thanks!

+2  A: 

Wanted to follow up on this. The answer was that ngnix does not handle these requests. We're writing a module to deal with that, and hope to contribute it back to the community.

ctmiller
+1  A: 

Any updates on this module?

antono
A: 

Is this module available yet by any chance?

Shaun
A: 

bump... because I don't want to go back to apache... yuck!

more specifically: I'm using CORS // XHR2 - gotta have OPTIONS!

CoolAJ86
It seems like the easiest way is to proxy the request to the application server (Rails, Node, TurboGears, whatever) that's sitting behind Nginx. That seems to be working for me... after some hacking to get the application server to support OPTIONS...
CoolAJ86