Welcome! Log In Create A New Profile

Advanced

Setting up Nginx with load balancing device healthchecks

Posted by chuck 
Setting up Nginx with load balancing device healthchecks
June 01, 2009 06:12PM
Has anyone successfully configured Nginx (0.6.36) and a CAI WebMux (http://cainetworks.com/manuals/webmux/wms8504_man.pdf ) or other hardware load balancer to work properly with a custom TCP healthcheck? Essentially when it sees OK in the response the WebMux will keep a machine in the farm of servers it is balancing between but anything else and it removes it.

Supposedly the CAI WebMux supports setting up a custom healthcheck. Mine is configured to look at /healthcheck.html on port 12160 while we're testing and I've setup the corresponding config in my nginx.conf to serve up a file on the file system.
[code]
server {
listen 12160;
server_name _;

location ^~ /healthcheck.html {
root /opt/healthcheck/12160;
}
}
[/code]

Everything work as expected when I retrieve the url using Curl.
[code]
[ops@196455-web3 logs]$ curl http://localhost:12160/healthcheck.html
OK
[/code]

However, when the WebMux retrieves it I see 400s returned in the access.log.
[code]
192.168.100.74 - - [01/Jun/2009:14:55:22 -0700] GET /healthcheck.html?farm=192.168.100.75:12160&server=192.168.100.77:0&alive=0&standby=0&favorite=1&lastresort=0&weight=1 HTTP/1.0 "400" 173 0.000 "-" "-" "-" "-"
[/code]

Obviously the WebMux is passing in a query string but again when I send this request using Curl:
[code]
[ops@196455-web3 logs]$ curl "http://localhost:12160/healthcheck.html?farm=192.168.100.75:12160&server=192.168.100.77:0&alive=0&standby=0&favorite=1&lastresort=0&weight=1"
OK
[/code]

Enabling debugging in the error log (error_log logs/error.log debug;) gives a little more information:
[code]
2009/06/01 14:37:04 [info] 9426#0: *7 client sent invalid host header while reading client request headers, client: 192.168.100.74, server: _, request: "GET /healthcheck.html?farm=192.168.100.75:12160&server=192.168.100.77:0&alive=0&standby=0&favorite=1&lastresort=0&weight=1 HTTP/1.0", host: ""
2009/06/01 14:37:05 [info] 9426#0: *8 client closed prematurely connection while reading client request line, client: 192.168.100.74, server: _
2009/06/01 14:37:05 [info] 9426#0: *9 client closed prematurely connection while reading client request line, client: 192.168.100.74, server: _
[/code]

At this point I start to run dry in my Google searches for suggestions. I'm guessing the WebMux is somehow formulating a request which nginx deems to be invalid and so it returns the 400. I found one post which suggested setting
[code]
proxy_ignore_client_abort on;
fastcgi_ignore_client_abort on;
[/code]
but I didn't have any success. Is there a way to get more verbose logging or other modules I should investigate using?

TIA,

chuck
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 58
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