]> granicus.if.org Git - apache/commitdiff
Add example of load balancing with stickyness using mod_headers.
authorStefan Fritsch <sf@apache.org>
Sun, 11 Oct 2009 21:00:13 +0000 (21:00 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 11 Oct 2009 21:00:13 +0000 (21:00 +0000)
PR: 46167

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@824151 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_proxy_balancer.xml

index 98efcfd0ff6491d3289f0646927ae1c1cd29625a..f6cb5908b4d2d8a6bad2f9189e8e36a6d8307bf7 100644 (file)
@@ -67,7 +67,7 @@
 </section>
 
 <section id="example">
-    <title>Example of a balancer configuration</title>
+    <title>Examples of a balancer configuration</title>
     <p>Before we dive into the technical details, here's an example of
     how you might use <module>mod_proxy_balancer</module> to provide
     load balancing between two back-end servers:
     &lt;/Proxy&gt;<br />
     ProxyPass /test balancer://mycluster/
     </example>
+
+    <p>Another example of how to provide load balancing with stickyness
+    using <module>mod_headers</module>, even if the backend server does
+    not set a suitable session cookie:
+    </p>
+
+    <example>
+    Header add Set-Cookie: "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
+           env=BALANCER_ROUTE_CHANGED<br />
+    &lt;Proxy balancer://mycluster&gt;<br />
+    BalancerMember http://192.168.1.50:80 route=1<br />
+    BalancerMember http://192.168.1.51:80 route=2<br />
+    ProxySet stickysession=ROUTEID<br />
+    &lt;/Proxy&gt;<br />
+    ProxyPass /test balancer://mycluster/
+    </example>
 </section>
 
 <section id="environment">