cep21 / healthcheck_nginx_upstreams

Health checks upstreams for nginx
http://wiki.nginx.org/NginxHttpHealthcheckModule
253 stars 597 forks source link

Healthcheck doesn't seem to do anything #14

Open fastdude7 opened 12 years ago

fastdude7 commented 12 years ago

With the hash module included and the following in the config

    upstream myproject {
            server 10.9.8.181:80; # weight=1 max_fails=1;
            server 10.9.8.193:80; # weight=1 max_fails=1;
            hash $filename;
            hash_again 2;
            healthcheck_enabled;
            healthcheck_delay 5000;
            healthcheck_timeout 20000;
            healthcheck_failcount 1;
            #healthcheck_expected 'I_AM_ALIVE';
            healthcheck_send "GET /health HTTP/1.0" 'Host: $http_host';
    }

    server {
            listen 80;
            server_name "";
            access_log log/localhost.access.log main;

            location / {
                  set $filename $request_uri;
                  if ($request_uri ~* ".*/(.*)") {
                    set $filename $1;
                  }
                  proxy_set_header Host $http_host;
                  proxy_pass http://myproject;
                  proxy_connect_timeout 3;
            }

            location /stat {
                    healthcheck_status;
            }
    }

If a the health check file is removed from one of the servers requests are still sent to that server. the stat page confirms the server is "down"

Perhaps this is not a issue with the health checking but a issue with http://github.com/cep21/nginx_upstream_hash/tree/support_http_healthchecks either way why is this module so difficult to use.