healthcheck do not working

Stone nginx-forum at
Fri Apr 15 12:25:11 MSD 2011

I tried to use the latest stable: nginx/1.0.0
I installed both this healthcheck_nginx_upstream and cep21 /
nginx_upstream_hash. Both patches 


The configure looked good:
./configure --add-module=/tmp/cep21-healthcheck_nginx_upstreams-5fa4bff/

http_stub_status_module --with-http_ssl_module
make && make install

finish it,no error and warning.

I used the sample nginx configs and have this:

 upstream main_servers {
#       hash $request_uri;
#       hash_again 0;
    healthcheck_delay 200;
    healthcheck_timeout 200;
    healthcheck_failcount 1;
    healthcheck_expected 'I_AM_ALIVE';
    healthcheck_buffer 32;
    healthcheck_send "GET /health HTTP/1.1" 'Host: $http_host';

    # The default server
    server {
        listen       81;
        server_name  _;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        proxy_set_header Host $http_host;

        #rewrite ^/destroute$ /destRoute/;

        location / {
            proxy_pass   http://main_servers;
            proxy_next_upstream timeout invalid_header;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
#    include /etc/nginx/conf.d/*.conf;

Q1:I can't use module hash.when I use it,tell me: nginx: [emerg]
unknown directive "hash" in 

So I delete it

There is no error report during executing.

In my opinion, when the "tomcat of host_192.168.0.242" hasn't totally
started, healthcheck regards it as unvailable and transfers the visit
link directly to "host_192.168.0.246".
It comes back after "host_192.168.0.242" has totally started.

But during the course of restart, there was no evidence showing that
healthcheck is working.

Does it happen beacause of my wrong setting or my lack of

Looking forward for your help. Thank you for your help in advance.

Best regards!

Posted at Nginx Forum:,191445,191445#msg-191445

More information about the nginx mailing list