From: Jim Jagielski Date: Fri, 22 Jan 2016 15:42:42 +0000 (+0000) Subject: Add examples X-Git-Tag: 2.5.0-alpha~2309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6ee76e6fa58be1669fb0a426a0cde68b638d82a;p=apache Add examples git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726238 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_proxy_hcheck.xml b/docs/manual/mod/mod_proxy_hcheck.xml index 6d209094e3..c1a88e56b3 100644 --- a/docs/manual/mod/mod_proxy_hcheck.xml +++ b/docs/manual/mod/mod_proxy_hcheck.xml @@ -90,6 +90,41 @@ mod_proxy +
+ + Usage examples +

The following example shows how one might configured health checking + for various backend servers:

+ + + +ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/} +ProxyHCExpr gdown %{REQUEST_STATUS} =~ /^[5]/} +ProxyHCExpr in_maint {hc('body') !~ /Under maintenance/} + +<Proxy balancer://foo> + BalancerMember http://www.example.com/ hcmethod=GET hcexpr=in_maint hcuri=/status.php + BalancerMember http://www2.example.com/ hcmethod=HEAD hcexpr=ok234 hcinterval=10 + BalancerMember http://www3.example.com/ hcmethod=TCP hcinterval=5 + BalancerMember http://www4.example.com/ +</Proxy> + +ProxyPass "/" "balancer://foo" +ProxyPassReverse "/" "balancer://foo" + + +

In this scenario, http://www.example.com/ is health checked by sending a GET /status.php +request to that server and seeing that the returned page does not include the string Under maintenance. If +it does, that server is put in health-check fail mode, and disabled. This dynamic check is performed +every 30 seconds, which is the default.

+ +

http://www2.example.com/ is checked by sending a simple HEAD request every +10 seconds and making sure that the response status is 2xx, 3xx or 4xx. http://www3.example.com/ is checked +every 5 seconds by simply ensuring that the socket to that server is up and http://www4.example.com/ is +not dynamically checked at all.

+ +
+ ProxyHCExpr Creates a named condition expression to use to determine health of the backend based on its response.