]> 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:50:45 +0000 (21:50 +0000)
committerRich Bowen <rbowen@apache.org>
Sun, 26 Dec 2004 21:50:45 +0000 (21:50 +0000)
another server. Thanks go to Matt Burke for submitting the example.

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

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

index 1417478bf655bb46d66d5b4656694b3ee5c7673b..8eb4669ee3a6e3d77bdb216681201f52c2005b08 100644 (file)
@@ -26,9 +26,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
@@ -45,6 +44,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 56f687fdbdb11bf84785f06d191b9e55b2ea6376..a7d114b86b8162f51251e36d36c06b419868c2a1 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>