httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1726238 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml
Date Fri, 22 Jan 2016 15:42:43 GMT
Author: jim
Date: Fri Jan 22 15:42:42 2016
New Revision: 1726238

URL: http://svn.apache.org/viewvc?rev=1726238&view=rev
Log:
Add examples

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml?rev=1726238&r1=1726237&r2=1726238&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy_hcheck.xml Fri Jan 22 15:42:42 2016
@@ -90,6 +90,41 @@
 </summary>
 <seealso><module>mod_proxy</module></seealso>
 
+<section id="examples">
+
+	<title>Usage examples</title>
+    <p>The following example shows how one might configured health checking
+    	for various backend servers:</p>
+
+	<!-- This section should probably be extended with more, useful examples -->
+	<highlight language="config">
+ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/}
+ProxyHCExpr gdown %{REQUEST_STATUS} =~ /^[5]/}
+ProxyHCExpr in_maint {hc('body') !~ /Under maintenance/}
+
+&lt;Proxy balancer://foo&gt;
+  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/
+&lt;/Proxy&gt;
+
+ProxyPass "/" "balancer://foo"
+ProxyPassReverse "/" "balancer://foo"
+</highlight>
+
+<p>In this scenario, <code>http://www.example.com/</code> is health checked
by sending a <code>GET /status.php</code>
+request to that server and seeing that the returned page does not include the string <em>Under
maintenance</em>. 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.</p>
+
+<p><code>http://www2.example.com/</code> is checked by sending a simple
<code>HEAD</code> request every
+10 seconds and making sure that the response status is 2xx, 3xx or 4xx. <code>http://www3.example.com/</code>
is checked
+every 5 seconds by simply ensuring that the socket to that server is up and <code>http://www4.example.com/</code>
is
+not dynamically checked at all.</p>
+
+</section>
+
 <directivesynopsis>
 <name>ProxyHCExpr</name>
 <description>Creates a named condition expression to use to determine health of the
backend based on its response.</description>



Mime
View raw message