Commit d5b13ae7 authored by Richard Bowen's avatar Richard Bowen
Browse files

As per bug #30308, added example where a virtual host is proxied to

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
parent ddefb22c
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -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
@@ -424,6 +425,27 @@

	</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>

+24 −3
Original line number Diff line number Diff line
@@ -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>

@@ -401,6 +400,28 @@
        ServerName www.example5.gov<br />
    </indent>
    &lt;/VirtualHost&gt;
    </example>

	</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>