]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
As per bug #30308, added example where a virtual host is proxied to
authorRich Bowen <rbowen@apache.org>
Sun, 26 Dec 2004 21:47:44 +0000 (21:47 +0000)
committerRich Bowen <rbowen@apache.org>
Sun, 26 Dec 2004 21:47:44 +0000 (21:47 +0000)
another server. Thanks go to Matt Burke for submitting the example.

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

docs/manual/vhosts/examples.html.en
docs/manual/vhosts/examples.xml

index 01e19dea6076795ee1ae3099335052340dae1740..06420544bde05dbb3370a74347ec61c6b7885654 100644 (file)
@@ -25,9 +25,8 @@
 
     <p>This document attempts to answer the commonly-asked questions about
     setting up virtual hosts. These scenarios are those involving multiple
-    web sites running on a single server, via <a href="name-based.html">name-based</a> or <a href="ip-based.html">IP-based</a> virtual hosts. A document should be
-    coming soon about running sites on several servers behind a single
-    proxy server.</p>
+    web sites running on a single server, via <a href="name-based.html">name-based</a> or <a href="ip-based.html">IP-based</a> virtual hosts.
+    </p>
 
 </div>
 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#purename">Running several name-based web
@@ -44,6 +43,8 @@
        hosts</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#mixed">Mixed name-based and IP-based
     vhosts</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#proxy">Using <code>Virtual_host</code> and
+    mod_proxy together</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#default">Using <code>_default_</code>
     vhosts</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#migrate">Migrating a name-based vhost to an
 
        </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
+<h2><a name="proxy" id="proxy">Using <code>Virtual_host</code> and
+    mod_proxy together</a></h2>
+
+    <p>The following example allows a front-end machine to proxy a
+    virtual host through to a server running on another machine. In the
+    example, a virtual host of the same name is configured on a machine
+    at <code>192.168.111.2</code>. The <code class="directive"><a href="../mod/mod_proxy.html#proxypreservehost on">ProxyPreserveHost On</a></code> directive is
+    used so that the desired hostname is passed through, in case we are
+    proxying multiple hostnames to a single machine.</p>
+
+    <div class="example"><p><code>
+    &lt;VirtualHost *:*&gt;<br />
+        ProxyPreserveHost On<br />
+        ProxyPass / http://192.168.111.2<br />
+        ProxyPassReverse / http://192.168.111.2/<br />
+        ServerName hostname.example.com<br />
+    &lt;/VirtualHost&gt;
+    </code></p></div>
+
+    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
 <h2><a name="default" id="default">Using <code>_default_</code>
     vhosts</a></h2>
 
index f88d5c7276d221102357b8facacea96a52ef877c..3f7019d42d1117d09023653194bc7318bf66cb04 100644 (file)
@@ -29,9 +29,8 @@
     setting up virtual hosts. These scenarios are those involving multiple
     web sites running on a single server, via <a
     href="name-based.html">name-based</a> or <a
-    href="ip-based.html">IP-based</a> virtual hosts. A document should be
-    coming soon about running sites on several servers behind a single
-    proxy server.</p>
+    href="ip-based.html">IP-based</a> virtual hosts.
+    </p>
 
 </summary>
 
 
        </section>
 
+    <section id="proxy"><title>Using <code>Virtual_host</code> and
+    mod_proxy together</title>
+
+    <p>The following example allows a front-end machine to proxy a
+    virtual host through to a server running on another machine. In the
+    example, a virtual host of the same name is configured on a machine
+    at <code>192.168.111.2</code>. The <directive
+    module="mod_proxy">ProxyPreserveHost On</directive> directive is
+    used so that the desired hostname is passed through, in case we are
+    proxying multiple hostnames to a single machine.</p>
+
+    <example>
+    &lt;VirtualHost *:*&gt;<br />
+        ProxyPreserveHost On<br />
+        ProxyPass / http://192.168.111.2<br />
+        ProxyPassReverse / http://192.168.111.2/<br />
+        ServerName hostname.example.com<br />
+    &lt;/VirtualHost&gt;
+    </example>
+
+    </section>
+
        <section id="default"><title>Using <code>_default_</code>
     vhosts</title>