]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Slightly more detail in the RewriteMap rnd: example, as well as
authorRich Bowen <rbowen@apache.org>
Sun, 26 Jun 2005 23:31:49 +0000 (23:31 +0000)
committerRich Bowen <rbowen@apache.org>
Sun, 26 Jun 2005 23:31:49 +0000 (23:31 +0000)
rewriting text that makes the feature sound less useful than it actually
is.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@201922 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_rewrite.html.en
docs/manual/mod/mod_rewrite.xml

index c0a3115f62fbb547f670efb2014fa26371d4c163..d2dd615265daf4e9965793d71375f82f2d775ec2 100644 (file)
@@ -1026,12 +1026,14 @@ RewriteMap real-to-user txt:/path/to/file/map.txt
           ``<code>|</code>'' characters which have the meaning of
           ``or''. In other words they indicate a set of
           alternatives from which the actual returned value is
-          chosen randomly. Although this sounds crazy and useless,
-          it was actually designed for load balancing in a reverse
-          proxy situation where the looked up values are server
-          names. Example:</p>
-
-<div class="example"><pre>
+          chosen randomly. For example, you might use the following map
+          file and directives to provide a random load balancing between
+          several back-end server, via a reverse-proxy. Images are sent
+          to one of the servers in the 'static' pool, while everything
+          else is sent to one of the 'dynamic' pool.</p>
+          <p>Example:</p>
+
+<div class="example"><h3>Rewrite map file</h3><pre>
 ##
 ##  map.txt -- rewriting map
 ##
@@ -1040,8 +1042,12 @@ static   www1|www2|www3|www4
 dynamic  www5|www6
 </pre></div>
 
-<div class="example"><p><code>
-RewriteMap servers rnd:/path/to/file/map.txt
+<div class="example"><h3>Configuration directives</h3><p><code>
+RewriteMap servers rnd:/path/to/file/map.txt<br />
+<br />
+RewriteRule ^/(.*\.(png|gif|jpg)) http://${servers:static}/$1
+[NC,P,L]<br />
+RewriteRule ^/(.*) http://${servers:dynamic}/$1 [P,L]
 </code></p></div>
         </li>
 
index 1740f153f0730a7721d371a12604d854892e4506..b8bc81cfba48aca8b20ad26a1c0c7c1ac9a923d6 100644 (file)
@@ -557,12 +557,14 @@ RewriteMap real-to-user txt:/path/to/file/map.txt
           ``<code>|</code>'' characters which have the meaning of
           ``or''. In other words they indicate a set of
           alternatives from which the actual returned value is
-          chosen randomly. Although this sounds crazy and useless,
-          it was actually designed for load balancing in a reverse
-          proxy situation where the looked up values are server
-          names. Example:</p>
-
-<example>
+          chosen randomly. For example, you might use the following map
+          file and directives to provide a random load balancing between
+          several back-end server, via a reverse-proxy. Images are sent
+          to one of the servers in the 'static' pool, while everything
+          else is sent to one of the 'dynamic' pool.</p>
+          <p>Example:</p>
+
+<example><title>Rewrite map file</title>
 <pre>
 ##
 ##  map.txt -- rewriting map
@@ -573,8 +575,12 @@ dynamic  www5|www6
 </pre>
 </example>
 
-<example>
-RewriteMap servers rnd:/path/to/file/map.txt
+<example><title>Configuration directives</title>
+RewriteMap servers rnd:/path/to/file/map.txt<br />
+<br />
+RewriteRule ^/(.*\.(png|gif|jpg)) http://${servers:static}/$1
+[NC,P,L]<br />
+RewriteRule ^/(.*) http://${servers:dynamic}/$1 [P,L]
 </example>
         </li>