Permalink
Browse files

First commit of upstream healthcheck plugin

Healthcheck plugin for nginx.  It polls backends and if they respond with
HTTP 200 + an optional request body, they are marked good.  Otherwise, they
are marked bad.

For help on all the options, see the docblocks inside the .c file where each
option is defined.

Note this also gives you access to a health status page that lets you see
how well your healthcheck are doing.

:::::Important:::::
Nginx gives you full freedom which server peer to pick when you write an
upstream.  This means that the healthchecking plugin is only a tool that
other upstreams must know about to use.  So your upstream code MUST SUPPORT
HEALTHCHECKS.  It's actually pretty easy to modify the code to support them.

See the .h file for how as well as the upstream_hash patch which shows
how to modify upstream_hash to support healthchecks.
  • Loading branch information...
0 parents commit a281cb8ed686139c43c750dc9fdb204c916831a7 @cep21 committed Feb 26, 2010
Showing with 1,153 additions and 0 deletions.
  1. +21 −0 README
  2. +5 −0 config
  3. +1,044 −0 ngx_http_healthcheck_module.c
  4. +28 −0 ngx_http_healthcheck_module.h
  5. +55 −0 sample_ngx_config.conf
21 README
@@ -0,0 +1,21 @@
+Healthcheck plugin for nginx. It polls backends and if they respond with
+HTTP 200 + an optional request body, they are marked good. Otherwise, they
+are marked bad.
+
+For help on all the options, see the docblocks inside the .c file where each
+option is defined.
+
+Note this also gives you access to a health status page that lets you see
+how well your healthcheck are doing.
+
+
+:::::Important:::::
+Nginx gives you full freedom which server peer to pick when you write an
+upstream. This means that the healthchecking plugin is only a tool that
+other upstreams must know about to use. So your upstream code MUST SUPPORT
+HEALTHCHECKS. It's actually pretty easy to modify the code to support them.
+
+See the .h file for how as well as the upstream_hash patch which shows
+how to modify upstream_hash to support healthchecks.
+
+Author: Jack Lindamood <jack@facebook.com>
5 config
@@ -0,0 +1,5 @@
+ngx_addon_name=ngx_http_healthcheck_module
+HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
+HTTP_MODULES="$HTTP_MODULES ngx_http_healthcheck_module"
+NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_healthcheck_module.c"
+have=NGX_HTTP_HEALTHCHECK . auto/have
Oops, something went wrong.

0 comments on commit a281cb8

Please sign in to comment.