snipt

Ctrl+h for KB shortcuts

Text only

redirect a directory to another host

#put this into /etc/apache/conf.d
ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
        Order deny,allow
        Allow from all
</Proxy>

<Directory /var/www/myapp>
        ProxyPass http://host/
        ProxyPassReverse http://host/
</Directory>
https://snipt.net/embed/84f74bf326c2b7fd42616fa30cf9792c/
/raw/84f74bf326c2b7fd42616fa30cf9792c/
84f74bf326c2b7fd42616fa30cf9792c
text
Text only
14
2019-07-16T10:48:16
True
False
False
/api/public/snipt/4818/
redirect-a-directory-to-another-host
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a> <a href="#L-12">12</a> <a href="#L-13">13</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>#put this into /etc/apache/conf.d </span><span id="L-2"><a name="L-2"></a>ProxyRequests Off </span><span id="L-3"><a name="L-3"></a>ProxyPreserveHost On </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>&lt;Proxy *&gt; </span><span id="L-6"><a name="L-6"></a> Order deny,allow </span><span id="L-7"><a name="L-7"></a> Allow from all </span><span id="L-8"><a name="L-8"></a>&lt;/Proxy&gt; </span><span id="L-9"><a name="L-9"></a> </span><span id="L-10"><a name="L-10"></a>&lt;Directory /var/www/myapp&gt; </span><span id="L-11"><a name="L-11"></a> ProxyPass http://host/ </span><span id="L-12"><a name="L-12"></a> ProxyPassReverse http://host/ </span><span id="L-13"><a name="L-13"></a>&lt;/Directory&gt; </span></pre></div> </td></tr></table>
apache, configuration, proxy