You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2010/04/13 13:21:00 UTC
svn commit: r933559 - in /httpd/httpd/trunk/docs/manual/mod:
mod_substitute.html.en mod_substitute.xml
Author: rbowen
Date: Tue Apr 13 11:21:00 2010
New Revision: 933559
URL: http://svn.apache.org/viewvc?rev=933559&view=rev
Log:
Example for using mod_substitute a la mod_proxy_html, in proxy context,
to fix hard-coded URLs in HTML.
Modified:
httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en
httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml
Modified: httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en?rev=933559&r1=933558&r2=933559&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_substitute.html.en Tue Apr 13 11:21:00 2010
@@ -97,6 +97,29 @@
</Location>
</code></p></div>
+ <p>A common use scenario for <code>mod_substitute</code> is the
+ situation in which a front-end server proxies requests to a back-end
+ server which returns HTML with hard-coded embedded URLs that refer
+ to the back-end server. These URLs don't work for the end-user,
+ since the back-end server is unreachable.</p>
+
+ <p>In this case, <code>mod_substutite</code> can be used to rewrite
+ those URLs into something that will work from the front end:</p>
+
+ <div class="example"><h3>Rewriting URLs embedded in proxied content</h3><p><code>
+ ProxyPass /blog/ http://internal.blog.example.com<br />
+ ProxyPassReverse /blog/ http://internal.blog.example.com/<br />
+ <br />
+ Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i"
+ </code></p></div>
+
+ <p><code class="directive"><a href="../mod/mod_proxy.html#proxypassreverse">ProxyPassReverse</a></code>
+ modifies any <code>Location</code> (redirect) headers that are sent
+ by the back-end server, and, in this example,
+ <code>Substitute</code> takes care of the rest of the problem by
+ fixing up the HTML response as well.</p>
+
+
</div>
</div>
<div class="bottomlang">
Modified: httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml?rev=933559&r1=933558&r2=933559&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_substitute.xml Tue Apr 13 11:21:00 2010
@@ -90,6 +90,29 @@
</indent>
</Location>
</example>
+
+ <p>A common use scenario for <code>mod_substitute</code> is the
+ situation in which a front-end server proxies requests to a back-end
+ server which returns HTML with hard-coded embedded URLs that refer
+ to the back-end server. These URLs don't work for the end-user,
+ since the back-end server is unreachable.</p>
+
+ <p>In this case, <code>mod_substutite</code> can be used to rewrite
+ those URLs into something that will work from the front end:</p>
+
+ <example><title>Rewriting URLs embedded in proxied content</title>
+ ProxyPass /blog/ http://internal.blog.example.com<br />
+ ProxyPassReverse /blog/ http://internal.blog.example.com/<br />
+ <br />
+ Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i"
+ </example>
+
+ <p><directive module="mod_proxy">ProxyPassReverse</directive>
+ modifies any <code>Location</code> (redirect) headers that are sent
+ by the back-end server, and, in this example,
+ <code>Substitute</code> takes care of the rest of the problem by
+ fixing up the HTML response as well.</p>
+
</usage>
</directivesynopsis>