trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r789429 - /websites/staging/trafficserver/trunk/content/docs/trunk/admin/reverse-proxy-http-redirects/index.en.html
Date Tue, 10 May 2011 11:20:51 GMT
Author: buildbot
Date: Tue May 10 11:20:51 2011
New Revision: 789429

Log:
Staging update by buildbot

Modified:
    websites/staging/trafficserver/trunk/content/docs/trunk/admin/reverse-proxy-http-redirects/index.en.html

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/admin/reverse-proxy-http-redirects/index.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/admin/reverse-proxy-http-redirects/index.en.html
(original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/admin/reverse-proxy-http-redirects/index.en.html
Tue May 10 11:20:51 2011
@@ -67,18 +67,15 @@ example scenarios. </p>
 <li>Deliver content efficiently in geographically distant areas</li>
 <li>Provide security for origin servers that contain sensitive information </li>
 </ul>
-<h4 id="OffloadingHeavily-UsedOriginServers">Offloading Heavily-Used Origin Servers</h4>
+<h4 id="OffloadingHeavilyUsedOriginServers">Offloading Heavily-Used Origin Servers</h4>
 <p>Traffic Server can absorb requests to the main origin server and improve the 
 speed &amp; quality of web serving by reducing load and hot spots on backup origin 
 servers. For example, a web hoster can maintain a scalable Traffic Server serving 
 engine with a set of low-cost, low-performance, less-reliable PC origin servers 
 as backup servers. In fact, a single Traffic Server can act as the virtual 
 origin server for multiple backup origin servers, as shown in the figure below. </p>
-<p><img alt="" src="images/revproxy.jpg" /></p>
-<blockquote>
-<p><em><strong>Traffic Server as reverse proxy for a pair of origin servers
</strong></em></p>
-</blockquote>
-<h4 id="DeliveringContentinGeographically-DispersedAreas">Delivering Content in Geographically-Dispersed
Areas</h4>
+<p><img alt="Traffic Server as reverse proxy for a pair of origin servers" src="/images/admin/revproxy.jpg"
/></p>
+<h4 id="DeliveringContentinGeographicallyDispersedAreas">Delivering Content in Geographically-Dispersed
Areas</h4>
 <p>Traffic Server can be used in reverse proxy mode to accelerate origin servers 
 that provide content to areas not located within close geographical proximity. 
 Caches are typically easier to manage and are more cost-effective than replicating 
@@ -116,10 +113,7 @@ hostname must not be the same. </p>
 <p>In reverse proxy mode, Traffic Server serves HTTP requests on behalf of a web 
 server. The figure below illustrates how Traffic Server in reverse proxy mode 
 serves an HTTP request from a client browser. </p>
-<p><img alt="" src="images/httprvs.jpg" /></p>
-<blockquote>
-<p><em><strong>HTTP reverse proxy </strong></em></p>
-</blockquote>
+<p><img alt="HTTP reverse proxy" src="/images/admin/httprvs.jpg" /></p>
 <p>The figure above demonstrates the following steps: </p>
 <ol>
 <li>A client browser sends an HTTP request addressed to a host called <code>www.host.com</code>
on port 80. Traffic Server receives the request because it is acting as the origin server
(the origin server’s advertised hostname resolves to Traffic Server). </li>
@@ -140,17 +134,27 @@ proxy requests. In reverse proxy caching
 as an origin server rather than a proxy server - this means that it receives 
 server requests and not proxy requests. Therefore, to satisfy proxy requests, 
 Traffic Server must construct a proxy request from the server request. </p>
-<p>In HTTP, proxy requests specify the entire URL whereas server requests specify only
the path. A server request might look like this:<br />
-<code>GET /index.html HTTP/1.0 Host: real.dianes_books.com</code><br />
-</p>
-<p>However, the corresponding proxy request would look like this: <br />
-<code>GET http://real.dianes_books.com/index.html HTTP/1.0 Host: real.dianes_books.com</code></p>
-<p>Traffic Server can construct a proxy request from a server request by using the
server information in the host header. However, the correct proxy request must contain the
hostname of the origin server, not the advertised hostname that name servers associate to
Traffic Server. The advertised hostname is the name that appears in the host header; for the
origin server <code>real.dianes_books.com</code>, the server request and host
header would be:<br />
-<code>GET /index.html HTTP/1.0 Host: www.dianes_books.com</code></p>
-<p>And the correct proxy request should be <br />
-<code>GET http://real.dianes_books.com/index.html HTTP/1.0 Host: real.dianes_books.com</code>
<br />
-</p>
-<p>To translate <code>www.dianes_books.com</code> to <code>real.dianes_books.com</code>,
Traffic Server 
+<p>In HTTP, proxy requests specify the entire URL whereas server requests specify only
the path. A server request might look like this:</p>
+<div class="codehilite"><pre><span class="n">GET</span> <span
class="sr">/index.html HTTP/</span><span class="mf">1.0</span> <span
class="n">Host:</span> <span class="n">real</span><span class="o">.</span><span
class="n">dianes</span><span class="o">-</span><span class="n">books</span><span
class="o">.</span><span class="n">com</span>
+</pre></div>
+
+
+<p>However, the corresponding proxy request would look like this</p>
+<div class="codehilite"><pre><span class="n">GET</span> <span
class="n">http:</span><span class="sr">//</span><span class="n">real</span><span
class="o">.</span><span class="n">dianes</span><span class="o">-</span><span
class="n">books</span><span class="o">.</span><span class="n">com</span><span
class="sr">/index.html HTTP/</span><span class="mf">1.0</span> <span
class="n">Host:</span> <span class="n">real</span><span class="o">.</span><span
class="n">dianes</span><span class="o">-</span><span class="n">books</span><span
class="o">.</span><span class="n">com</span>
+</pre></div>
+
+
+<p>Traffic Server can construct a proxy request from a server request by using the
server information in the host header. However, the correct proxy request must contain the
hostname of the origin server, not the advertised hostname that name servers associate to
Traffic Server. The advertised hostname is the name that appears in the host header; for the
origin server <code>real.dianes-books.com</code>, the server request and host
header would be:</p>
+<div class="codehilite"><pre><span class="n">GET</span> <span
class="sr">/index.html HTTP/</span><span class="mf">1.0</span> <span
class="n">Host:</span> <span class="n">www</span><span class="o">.</span><span
class="n">dianes</span><span class="o">-</span><span class="n">books</span><span
class="o">.</span><span class="n">com</span>
+</pre></div>
+
+
+<p>And the correct proxy request should be</p>
+<div class="codehilite"><pre> <span class="n">GET</span> <span
class="n">http:</span><span class="sr">//</span><span class="n">real</span><span
class="o">.</span><span class="n">dianes</span><span class="o">-</span><span
class="n">books</span><span class="o">.</span><span class="n">com</span><span
class="sr">/index.html HTTP/</span><span class="mf">1.0</span> <span
class="n">Host:</span> <span class="n">real</span><span class="o">.</span><span
class="n">dianes</span><span class="o">-</span><span class="n">books</span><span
class="o">.</span><span class="n">com</span>
+</pre></div>
+
+
+<p>To translate <code>www.dianes-books.com</code> to <code>real.dianes-books.com</code>,
Traffic Server 
 needs a set of URL rewriting rules (mapping rules). Mapping rules are described 
 in <a href="#UsingMappingRulesHTTPRequests">Using Mapping Rules for HTTP Requests</a>.
</p>
 <p>In general, use reverse proxy mode to support more than one origin server. 
@@ -194,28 +198,15 @@ stores mapping rules in the <code>remap.
 <code>config</code> directory.</p>
 <h5 id="createmappingrules">To create mapping rules:</h5>
 <ol>
-<li>In a text editor, open the <code>remap.config</code> file located in
the Traffic Server <code>config</code> directory. </li>
-<li>Enter your map and reverse-map rules (refer to <a href="files.htm#remap.config">remap.config</a>).
</li>
-<li>Save and close the <code>remap.config</code> file. </li>
-<li>Navigate to the Traffic Server <code>bin</code> directory. </li>
+<li>In the <a href="../configuration-files/remap.config"><code>remap.config</code></a></li>
+<li>Enter your map and reverse-map rules</li>
 <li>Run the command <code>traffic_line -x</code> to apply the configuration
changes.</li>
 </ol>
 <h3 id="EnablingHTTPReverseProxy">Enabling HTTP Reverse Proxy</h3>
 <p>To enable HTTP reverse proxy, follow the steps below.</p>
 <ol>
-<li>In a text editor, open the <code>records.config</code> file located
in the <code>config</code> directory. </li>
-<li>Edit the following variable:</li>
-<li>
-<dl>
-<dt><strong>Variable</strong> <strong>Description</strong></dt>
-<dt><code>_proxy.config.reverse_proxy.enabled_</code></dt>
-<dd>Set this variable to 1 to enable HTTP reverse proxy mode. </dd>
-</dl>
-</li>
-<li>
-<p>Save and close the <code>records.config</code> file. </p>
-</li>
-<li>Navigate to the Traffic Server <code>bin</code> directory. </li>
+<li>In the <a href="../configuration-files/records.config"><code>records.config</code></a></li>
+<li>Edit the variable <a href="../configuration-files/records.config#proxy.config.reverse_proxy.enabled"><em><code>proxy.config.reverse_proxy.enabled</code></em></a></li>
 <li>Run the command <code>traffic_line -x</code> to apply the configuration
changes. </li>
 </ol>
 <h3 id="SettingOptionalHTTPReverseProxyOptions">Setting Optional HTTP Reverse Proxy
Options</h3>
@@ -228,25 +219,10 @@ you to: </p>
 </ul>
 <h5 id="setoptionalHTTPreverseproxyoptions">To set optional HTTP reverse proxy options:</h5>
 <ol>
-<li>In a text editor, open the <code>records.config</code> file located
in the <code>config</code> directory. </li>
-<li>Edit the following variables:</li>
-<li>
-<dl>
-<dt><strong>Variable</strong> <strong>Description</strong></dt>
-<dt><code>_proxy.config.url_remap.pristine_host_hdr_</code></dt>
-<dd>Set this variable to 1 to retain the client host header in the request. <br
/>
-     Set this variable to 0 (zero) if you want Traffic Server to translate the client host
header.</dd>
-<dt><code>_proxy.config.url_remap.remap_required_</code></dt>
-<dd>Set this variable to 1 if you want Traffic Server to serve requests only to the
origin servers listed in the mapping rules of the <code>remap.config</code> file.
<br />
-     Set this variable to 0 (zero) if you want Traffic Server to serve requests to all origin
servers.</dd>
-<dt><code>_proxy.config.header.parse.no_host_url_redirect_</code></dt>
-<dd>Enter the URL to which to redirect requests with no host headers.</dd>
-</dl>
-</li>
-<li>
-<p>Save and close the <code>records.config</code> file. </p>
-</li>
-<li>Navigate to the Traffic Server <code>bin</code> directory. </li>
+<li>In the <a href="../configuration-files/records.config"><code>records.config</code></a></li>
+<li>Edit the variable <a href="../configuration-files/records.config#proxy.config.url_remap.pristine_host_hdr"><em><code>proxy.config.url_remap.pristine_host_hdr</code></em></a></li>
+<li>Edit the variable <a href="../configuration-files/records.config#proxy.config.url_remap.remap_required"><em><code>proxy.config.url_remap.remap_required</code></em></a></li>
+<li>Edit the variable <a href="../configuration-files/records.config#proxy.config.header.parse.no_host_url_redirect"><em><code>proxy.config.header.parse.no_host_url_reedirect</code></em></a></li>
 <li>Run the command <code>traffic_line -x</code> to apply the configuration
changes. </li>
 </ol>
 <h2 id="RedirectingHTTPRequests">Redirecting HTTP Requests</h2>
@@ -256,60 +232,19 @@ to <code>http://www.server1.com/products
 for <code>www.ultraseek.com</code> go directly to <code>www.server1.com/products/portal/search</code>.
</p>
 <p>You can configure Traffic Server to perform permanent or temporary redirects. 
 <strong>Permanent redirects</strong> notify the browser of the URL change (by
returning 
-the HTTP status code <code>**301**</code>) so that the browser can update bookmarks.
<strong>Temporary 
-redirects </strong>notify the browser of the URL change for the current request only

-(by returning the HTTP status code <strong><code>307</code></strong>).</p>
+the HTTP status code <strong><code>301</code></strong>) so that the
browser can update bookmarks. <strong>Temporary 
+redirects</strong> notify the browser of the URL change for the current request only

+(by returning the HTTP status code <strong><code>307</code></strong>
).</p>
 <h5 id="setredirectrules">To set redirect rules:</h5>
 <ol>
-<li>In a text editor, open the <code>remap.config</code> file located in
the Traffic Server <code>config</code> directory. </li>
-<li>The following permanently redirects all HTTP requests for <code>www.server1.com</code>
to <code>www.server2.com</code> :<br />
-<code>redirect http://www.server1.com http://www.server2.com</code><br />
-<dl>
-<dt>Enter a mapping rule for each redirect you want to set. Each mapping rule must
be on a separate line and must consist of three space-delimited fields: <code>type</code>,
<code>target</code>, and <code>replacement</code>. The following table
describes the format for each field.</dt>
-<dt><strong>Field</strong> <strong>Description</strong></dt>
-<dt><code>type</code></dt>
-<dd>Enter either one of the following: <br />
-<code>redirect</code>—redirects HTTP requests permanently without having
to contact the origin server. <br />
-<code>redirect_temporary</code>—redirects HTTP requests temporarily without
having to contact the origin server.</dd>
-<dt><code>target</code></dt>
-<dd>Enter the origin or from URL. You can enter up to four components: <br />
-<em><code>scheme://host:port/path_prefix</code></em></dd>
-<dt><code>replacement</code></dt>
-<dd>Enter the destination or to URL. You can enter up to four components: <br />
-<em><code>scheme://host:port/path_prefix</code></em></dd>
-</dl>
-</li>
-<li>
-<p>Save and close the <code>remap.config</code> file. </p>
-</li>
-<li>Navigate to the Traffic Server <code>bin</code> directory. </li>
-<li>
-<p>Run the command <code>traffic_line -x</code> to apply the configuration
changes.</p>
-</li>
-<li>
-<p><a href="intro.htm">Overview</a></p>
-</li>
-<li><a href="getstart.htm">Getting Started</a></li>
-<li><a href="http.htm">HTTP Proxy Caching </a></li>
-<li><a href="explicit.htm">Explicit Proxy Caching</a></li>
-<li><a href="reverse.htm">Reverse Proxy and HTTP Redirects</a></li>
-<li><a href="hier.htm">Hierarchical Caching</a></li>
-<li><a href="cache.htm">Configuring the Cache</a></li>
-<li><a href="monitor.htm">Monitoring Traffic</a></li>
-<li><a href="configure.htm">Configuring Traffic Server</a></li>
-<li><a href="secure.htm">Security Options</a></li>
-<li><a href="log.htm">Working with Log Files</a></li>
-<li><a href="cli.htm">Traffic Line Commands</a></li>
-<li><a href="logfmts.htm">Event Logging Formats</a></li>
-<li><a href="files.htm">Configuration Files</a> </li>
-<li><a href="errors.htm">Traffic Server Error Messages</a></li>
-<li><a href="trouble.htm">FAQ and Troubleshooting Tips</a></li>
-<li><a href="ts_admin_chinese.pdf">Traffic Server 管理员指南</a>
(PDF)</li>
+<li>In the <a href="../configuration-files/remap.config"><code>remap.config</code></a></li>
+<li>Enter a mapping rule for each redirect you want to set.</li>
+<li>Run the command <code>traffic_line -x</code> to apply the configuration
changes.</li>
 </ol>
-<p>Copyright © 2011 <a href="http://www.apache.org/">The Apache Software Foundation</a>.

-Licensed under the <a href="http://www.apache.org/licenses/">Apache License</a>,
Version 
-2.0. Apache Traffic Server, Apache, the Apache Traffic Server logo, and the 
-Apache feather logo are trademarks of The Apache Software Foundation.</p>
+<p><strong>Example</strong></p>
+<p>The following permanently redirects all HTTP requests for <code>www.server1.com</code>
to <code>www.server2.com</code>:</p>
+<div class="codehilite"><pre><span class="n">redirect</span> <span
class="n">http:</span><span class="sr">//</span><span class="n">www</span><span
class="o">.</span><span class="n">server1</span><span class="o">.</span><span
class="n">com</span> <span class="n">http:</span><span class="sr">//</span><span
class="n">www</span><span class="o">.</span><span class="n">server2</span><span
class="o">.</span><span class="n">com</span>
+</pre></div>
     </div>
   </div><!-- main -->
 



Mime
View raw message