Introducing backend healthchecking plugin

Arvind Jayaprakash work at
Mon Mar 1 13:48:32 MSK 2010

On Feb 26, Jack Lindamood wrote:
>I've written a plugin that can health check nginx backends, which
>everyone is free to use.  This is similar to the healthchecking
>features that varnish and haproxy support.  Here's a sample config[1]
>just to give you an idea, that uses the upstream_hash plugin.  You can
>get the code here [2] and an example of how to patch upstream_hash here
>[3].  The plugin is actually an optional feature that other upstream
>plugins, like upstream fair or iphash for example, can plug into and
>use.  To use it, their code needs to be modified to also check the
>health of the backend.
>This plugin is super beta, so please be careful.  Feedback/patches

I have been wanting to write something similar from a long time, so
thanks for getting started.

Does the health check compete with the existing logic to mark an
upstream as up/down? Here is a scenario:

The real traffic goes to this upstream url "/service/login". My health
check url is configured as "/hc". Now /hc is always available by
/service/login is thowing up a lot of errors like timeouts, 500 etc.
etc for a given upstream server. What will the status be eventually
marked as?

More information about the nginx mailing list