home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _7A0AA203734684232DDC3F852A97AD63 < prev    next >
Extensible Markup Language  |  2008-01-02  |  83KB  |  1,392 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>mod_proxy - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  16. <p class="apache">Apache HTTP Server Version 2.2</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_proxy</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English"> en </a> |
  25. <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  26. </div>
  27. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>HTTP/1.1 proxy/gateway server</td></tr>
  28. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  29. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>proxy_module</td></tr>
  30. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_proxy.c</td></tr></table>
  31. <h3>Summary</h3>
  32.  
  33.     <div class="warning"><h3>Warning</h3>
  34.       <p>Do not enable proxying with <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> until you have <a href="#access">secured your server</a>. Open proxy servers are dangerous both to your
  35.       network and to the Internet at large.</p>
  36.     </div>
  37.  
  38.     <p>This module implements a proxy/gateway for Apache. It implements
  39.     proxying capability for <code>AJP13</code> (Apache JServe Protocol
  40.     version 1.3), <code>FTP</code>, <code>CONNECT</code> (for SSL),
  41.     <code>HTTP/0.9</code>, <code>HTTP/1.0</code>, and <code>HTTP/1.1</code>.
  42.     The module can be configured to connect to other proxy modules for these
  43.     and other protocols.</p>
  44.  
  45.     <p>Apache's proxy features are divided into several modules in
  46.     addition to <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>:
  47.     <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>, <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>,
  48.     <code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code>, <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>,
  49.     and <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code>.  Thus, if you want to use
  50.     one or more of the particular proxy functions, load
  51.     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> <em>and</em> the appropriate module(s)
  52.     into the server (either statically at compile-time or dynamically
  53.     via the <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>
  54.     directive).</p>
  55.  
  56.     <p>In addition, extended features are provided by other modules.
  57.     Caching is provided by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and related
  58.     modules.  The ability to contact remote servers using the SSL/TLS
  59.     protocol is provided by the <code>SSLProxy*</code> directives of
  60.     <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>.  These additional modules will need
  61.     to be loaded and configured to take advantage of these features.</p>
  62. </div>
  63. <div id="quickview"><h3 class="directives">Directives</h3>
  64. <ul id="toc">
  65. <li><img alt="" src="../images/down.gif" /> <a href="#allowconnect">AllowCONNECT</a></li>
  66. <li><img alt="" src="../images/down.gif" /> <a href="#balancermember">BalancerMember</a></li>
  67. <li><img alt="" src="../images/down.gif" /> <a href="#noproxy">NoProxy</a></li>
  68. <li><img alt="" src="../images/down.gif" /> <a href="#proxy"><Proxy></a></li>
  69. <li><img alt="" src="../images/down.gif" /> <a href="#proxybadheader">ProxyBadHeader</a></li>
  70. <li><img alt="" src="../images/down.gif" /> <a href="#proxyblock">ProxyBlock</a></li>
  71. <li><img alt="" src="../images/down.gif" /> <a href="#proxydomain">ProxyDomain</a></li>
  72. <li><img alt="" src="../images/down.gif" /> <a href="#proxyerroroverride">ProxyErrorOverride</a></li>
  73. <li><img alt="" src="../images/down.gif" /> <a href="#proxyftpdircharset">ProxyFtpDirCharset</a></li>
  74. <li><img alt="" src="../images/down.gif" /> <a href="#proxyiobuffersize">ProxyIOBufferSize</a></li>
  75. <li><img alt="" src="../images/down.gif" /> <a href="#proxymatch"><ProxyMatch></a></li>
  76. <li><img alt="" src="../images/down.gif" /> <a href="#proxymaxforwards">ProxyMaxForwards</a></li>
  77. <li><img alt="" src="../images/down.gif" /> <a href="#proxypass">ProxyPass</a></li>
  78. <li><img alt="" src="../images/down.gif" /> <a href="#proxypassmatch">ProxyPassMatch</a></li>
  79. <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreverse">ProxyPassReverse</a></li>
  80. <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></li>
  81. <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></li>
  82. <li><img alt="" src="../images/down.gif" /> <a href="#proxypreservehost">ProxyPreserveHost</a></li>
  83. <li><img alt="" src="../images/down.gif" /> <a href="#proxyreceivebuffersize">ProxyReceiveBufferSize</a></li>
  84. <li><img alt="" src="../images/down.gif" /> <a href="#proxyremote">ProxyRemote</a></li>
  85. <li><img alt="" src="../images/down.gif" /> <a href="#proxyremotematch">ProxyRemoteMatch</a></li>
  86. <li><img alt="" src="../images/down.gif" /> <a href="#proxyrequests">ProxyRequests</a></li>
  87. <li><img alt="" src="../images/down.gif" /> <a href="#proxyset">ProxySet</a></li>
  88. <li><img alt="" src="../images/down.gif" /> <a href="#proxystatus">ProxyStatus</a></li>
  89. <li><img alt="" src="../images/down.gif" /> <a href="#proxytimeout">ProxyTimeout</a></li>
  90. <li><img alt="" src="../images/down.gif" /> <a href="#proxyvia">ProxyVia</a></li>
  91. </ul>
  92. <h3>Topics</h3>
  93. <ul id="topics">
  94. <li><img alt="" src="../images/down.gif" /> <a href="#forwardreverse">Forward and Reverse Proxies</a></li>
  95. <li><img alt="" src="../images/down.gif" /> <a href="#examples">Basic Examples</a></li>
  96. <li><img alt="" src="../images/down.gif" /> <a href="#access">Controlling access to your proxy</a></li>
  97. <li><img alt="" src="../images/down.gif" /> <a href="#startup">Slow Startup</a></li>
  98. <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
  99. <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
  100. <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodies</a></li>
  101. <li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
  102. </ul><h3>See also</h3>
  103. <ul class="seealso">
  104. <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
  105. <li><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></li>
  106. <li><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></li>
  107. <li><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></li>
  108. <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
  109. <li><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></li>
  110. </ul></div>
  111. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  112. <div class="section">
  113. <h2><a name="forwardreverse" id="forwardreverse">Forward and Reverse Proxies</a></h2>
  114.       <p>Apache can be configured in both a <dfn>forward</dfn> and
  115.       <dfn>reverse</dfn> proxy mode.</p>
  116.  
  117.       <p>An ordinary <dfn>forward proxy</dfn> is an intermediate
  118.       server that sits between the client and the <em>origin
  119.       server</em>.  In order to get content from the origin server,
  120.       the client sends a request to the proxy naming the origin server
  121.       as the target and the proxy then requests the content from the
  122.       origin server and returns it to the client.  The client must be
  123.       specially configured to use the forward proxy to access other
  124.       sites.</p>
  125.  
  126.       <p>A typical usage of a forward proxy is to provide Internet
  127.       access to internal clients that are otherwise restricted by a
  128.       firewall.  The forward proxy can also use caching (as provided
  129.       by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>) to reduce network usage.</p>
  130.  
  131.       <p>The forward proxy is activated using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive.  Because
  132.       forward proxies allow clients to access arbitrary sites through
  133.       your server and to hide their true origin, it is essential that
  134.       you <a href="#access">secure your server</a> so that only
  135.       authorized clients can access the proxy before activating a
  136.       forward proxy.</p>
  137.  
  138.       <p>A <dfn>reverse proxy</dfn>, by contrast, appears to the
  139.       client just like an ordinary web server.  No special
  140.       configuration on the client is necessary.  The client makes
  141.       ordinary requests for content in the name-space of the reverse
  142.       proxy.  The reverse proxy then decides where to send those
  143.       requests, and returns the content as if it was itself the
  144.       origin.</p>
  145.  
  146.       <p>A typical usage of a reverse proxy is to provide Internet
  147.       users access to a server that is behind a firewall.  Reverse
  148.       proxies can also be used to balance load among several back-end
  149.       servers, or to provide caching for a slower back-end server.
  150.       In addition, reverse proxies can be used simply to bring
  151.       several servers into the same URL space.</p>
  152.  
  153.       <p>A reverse proxy is activated using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive or the
  154.       <code>[P]</code> flag to the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive.  It is
  155.       <strong>not</strong> necessary to turn <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> on in order to
  156.       configure a reverse proxy.</p>
  157.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  158. <div class="section">
  159. <h2><a name="examples" id="examples">Basic Examples</a></h2>
  160.  
  161.     <p>The examples below are only a very basic idea to help you
  162.     get started.  Please read the documentation on the individual
  163.     directives.</p>
  164.  
  165.     <p>In addition, if you wish to have caching enabled, consult
  166.     the documentation from <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
  167.  
  168.     <div class="example"><h3>Forward Proxy</h3><p><code>
  169.     ProxyRequests On<br />
  170.     ProxyVia On<br />
  171.     <br />
  172.     <Proxy *><br />
  173.     <span class="indent">
  174.       Order deny,allow<br />
  175.       Deny from all<br />
  176.       Allow from internal.example.com<br />
  177.     </span>
  178.     </Proxy>
  179.     </code></p></div>
  180.  
  181.     <div class="example"><h3>Reverse Proxy</h3><p><code>
  182.     ProxyRequests Off<br />
  183.     <br />
  184.     <Proxy *><br />
  185.     <span class="indent">
  186.       Order deny,allow<br />
  187.       Allow from all<br />
  188.     </span>
  189.     </Proxy><br />
  190.     <br />
  191.     ProxyPass /foo http://foo.example.com/bar<br />
  192.     ProxyPassReverse /foo http://foo.example.com/bar
  193.     </code></p></div>
  194.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  195. <div class="section">
  196. <h2><a name="access" id="access">Controlling access to your proxy</a></h2>
  197.       <p>You can control who can access your proxy via the <code class="directive"><a href="#proxy"><Proxy></a></code> control block as in
  198.       the following example:</p>
  199.  
  200.       <div class="example"><p><code>
  201.         <Proxy *><br />
  202.         <span class="indent">
  203.           Order Deny,Allow<br />
  204.           Deny from all<br />
  205.           Allow from 192.168.0<br />
  206.         </span>
  207.         </Proxy>
  208.       </code></p></div>
  209.  
  210.       <p>For more information on access control directives, see
  211.       <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>.</p>
  212.  
  213.       <p>Strictly limiting access is essential if you are using a
  214.       forward proxy (using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive).
  215.       Otherwise, your server can be used by any client to access
  216.       arbitrary hosts while hiding his or her true identity.  This is
  217.       dangerous both for your network and for the Internet at large.
  218.       When using a reverse proxy (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive with
  219.       <code>ProxyRequests Off</code>), access control is less
  220.       critical because clients can only contact the hosts that you
  221.       have specifically configured.</p>
  222.  
  223.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  224. <div class="section">
  225. <h2><a name="startup" id="startup">Slow Startup</a></h2>
  226.       <p>If you're using the <code class="directive"><a href="#proxyblock">ProxyBlock</a></code> directive, hostnames' IP addresses are looked up
  227.       and cached during startup for later match test. This may take a few
  228.       seconds (or more) depending on the speed with which the hostname lookups
  229.       occur.</p>
  230.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  231. <div class="section">
  232. <h2><a name="intranet" id="intranet">Intranet Proxy</a></h2>
  233.       <p>An Apache proxy server situated in an intranet needs to forward
  234.       external requests through the company's firewall (for this, configure
  235.       the <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive
  236.       to forward the respective <var>scheme</var> to the firewall proxy).
  237.       However, when it has to
  238.       access resources within the intranet, it can bypass the firewall when
  239.       accessing hosts. The <code class="directive"><a href="#noproxy">NoProxy</a></code>
  240.       directive is useful for specifying which hosts belong to the intranet and
  241.       should be accessed directly.</p>
  242.  
  243.       <p>Users within an intranet tend to omit the local domain name from their
  244.       WWW requests, thus requesting "http://somehost/" instead of
  245.       <code>http://somehost.example.com/</code>. Some commercial proxy servers
  246.       let them get away with this and simply serve the request, implying a
  247.       configured local domain. When the <code class="directive"><a href="#proxydomain">ProxyDomain</a></code> directive is used and the server is <a href="#proxyrequests">configured for proxy service</a>, Apache can return
  248.       a redirect response and send the client to the correct, fully qualified,
  249.       server address. This is the preferred method since the user's bookmark
  250.       files will then contain fully qualified hosts.</p>
  251.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  252. <div class="section">
  253. <h2><a name="envsettings" id="envsettings">Protocol Adjustments</a></h2>
  254.       <p>For circumstances where <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> is sending
  255.       requests to an origin server that doesn't properly implement
  256.       keepalives or HTTP/1.1, there are two <a href="../env.html">environment variables</a> that can force the
  257.       request to use HTTP/1.0 with no keepalive. These are set via the
  258.       <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code> directive.</p>
  259.  
  260.       <p>These are the <code>force-proxy-request-1.0</code> and
  261.       <code>proxy-nokeepalive</code> notes.</p>
  262.  
  263.       <div class="example"><p><code>
  264.         <Location /buggyappserver/><br />
  265.         <span class="indent">
  266.           ProxyPass http://buggyappserver:7001/foo/<br />
  267.           SetEnv force-proxy-request-1.0 1<br />
  268.           SetEnv proxy-nokeepalive 1<br />
  269.         </span>
  270.         </Location>
  271.       </code></p></div>
  272.  
  273.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  274. <div class="section">
  275. <h2><a name="request-bodies" id="request-bodies">Request Bodies</a></h2>
  276.  
  277.     <p>Some request methods such as POST include a request body.
  278.     The HTTP protocol requires that requests which include a body
  279.     either use chunked transfer encoding or send a
  280.     <code>Content-Length</code> request header.  When passing these
  281.     requests on to the origin server, <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>
  282.     will always attempt to send the <code>Content-Length</code>.  But
  283.     if the body is large and the original request used chunked
  284.     encoding, then chunked encoding may also be used in the upstream
  285.     request.  You can control this selection using <a href="../env.html">environment variables</a>.  Setting
  286.     <code>proxy-sendcl</code> ensures maximum compatibility with
  287.     upstream servers by always sending the
  288.     <code>Content-Length</code>, while setting
  289.     <code>proxy-sendchunked</code> minimizes resource usage by using
  290.     chunked encoding.</p>
  291.  
  292.     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  293. <div class="section">
  294. <h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
  295.  
  296.     <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
  297.     <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
  298.     order to pass information to the origin server. These headers
  299.     are:</p>
  300.  
  301.     <dl>
  302.       <dt><code>X-Forwarded-For</code></dt>
  303.       <dd>The IP address of the client.</dd>
  304.       <dt><code>X-Forwarded-Host</code></dt>
  305.       <dd>The original host requested by the client in the <code>Host</code> 
  306.        HTTP request header.</dd>
  307.       <dt><code>X-Forwarded-Server</code></dt>
  308.       <dd>The hostname of the proxy server.</dd>
  309.     </dl>
  310.  
  311.     <p>Be careful when using these headers on the origin server, since
  312.     they will contain more than one (comma-separated) value if the
  313.     original request already contained one of these headers. For
  314.     example, you can use <code>%{X-Forwarded-For}i</code> in the log
  315.     format string of the origin server to log the original clients IP
  316.     address, but you may get more than one address if the request
  317.     passes through several proxies.</p>
  318.  
  319.     <p>See also the <code class="directive"><a href="#proxypreservehost">ProxyPreserveHost</a></code> and <code class="directive"><a href="#proxyvia">ProxyVia</a></code> directives, which control
  320.     other request headers.</p>
  321.  
  322.    </div>
  323. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  324. <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
  325. <table class="directive">
  326. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ports that are allowed to <code>CONNECT</code> through the
  327. proxy</td></tr>
  328. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowCONNECT <var>port</var> [<var>port</var>] ...</code></td></tr>
  329. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowCONNECT 443 563</code></td></tr>
  330. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  331. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  332. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  333. </table>
  334.     <p>The <code class="directive">AllowCONNECT</code> directive specifies a list
  335.     of port numbers to which the proxy <code>CONNECT</code> method may
  336.     connect.  Today's browsers use this method when a <code>https</code>
  337.     connection is requested and proxy tunneling over HTTP is in effect.</p>
  338.  
  339.     <p>By default, only the default https port (<code>443</code>) and the
  340.     default snews port (<code>563</code>) are enabled. Use the
  341.     <code class="directive">AllowCONNECT</code> directive to override this default and
  342.     allow connections to the listed ports only.</p>
  343.  
  344.     <p>Note that you'll need to have <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code> present
  345.     in the server in order to get the support for the <code>CONNECT</code> at
  346.     all.</p>
  347.  
  348. </div>
  349. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  350. <div class="directive-section"><h2><a name="BalancerMember" id="BalancerMember">BalancerMember</a> <a name="balancermember" id="balancermember">Directive</a></h2>
  351. <table class="directive">
  352. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Add a member to a load balancing group</td></tr>
  353. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>BalancerMember <var>url</var> [<var>key=value [key=value ...]]</var></code></td></tr>
  354. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
  355. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  356. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  357. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>BalancerMember is only available in Apache 2.2
  358.         and later.</td></tr>
  359. </table>
  360.     <p>This directive adds a member to a load balancing group. It must be used
  361.     within a <code><Proxy <var>balancer://</var>...></code> container
  362.     directive, and can take any of the parameters available to
  363.     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directives.</p>
  364.  
  365. </div>
  366. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  367. <div class="directive-section"><h2><a name="NoProxy" id="NoProxy">NoProxy</a> <a name="noproxy" id="noproxy">Directive</a></h2>
  368. <table class="directive">
  369. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hosts, domains, or networks that will be connected to
  370. directly</td></tr>
  371. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NoProxy <var>host</var> [<var>host</var>] ...</code></td></tr>
  372. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  373. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  374. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  375. </table>
  376.     <p>This directive is only useful for Apache proxy servers within
  377.     intranets.  The <code class="directive">NoProxy</code> directive specifies a
  378.     list of subnets, IP addresses, hosts and/or domains, separated by
  379.     spaces. A request to a host which matches one or more of these is
  380.     always served directly, without forwarding to the configured
  381.     <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> proxy server(s).</p>
  382.  
  383.     <div class="example"><h3>Example</h3><p><code>
  384.       ProxyRemote  *  http://firewall.mycompany.com:81<br />
  385.       NoProxy         .mycompany.com 192.168.112.0/21
  386.     </code></p></div>
  387.  
  388.     <p>The <var>host</var> arguments to the <code class="directive">NoProxy</code>
  389.     directive are one of the following type list:</p>
  390.  
  391.     <dl>
  392.     
  393.     <dt><var><a name="domain" id="domain">Domain</a></var></dt>
  394.     <dd>
  395.     <p>A <dfn>Domain</dfn> is a partially qualified DNS domain name, preceded
  396.     by a period. It represents a list of hosts which logically belong to the
  397.     same DNS domain or zone (<em>i.e.</em>, the suffixes of the hostnames are
  398.     all ending in <var>Domain</var>).</p>
  399.  
  400.     <div class="example"><h3>Examples</h3><p><code>
  401.       .com .apache.org.
  402.     </code></p></div>
  403.  
  404.     <p>To distinguish <var>Domain</var>s from <var><a href="#hostname">Hostname</a></var>s (both syntactically and semantically; a DNS domain can
  405.     have a DNS A record, too!), <var>Domain</var>s are always written with a
  406.     leading period.</p>
  407.     
  408.     <div class="note"><h3>Note</h3>
  409.       <p>Domain name comparisons are done without regard to the case, and
  410.       <var>Domain</var>s are always assumed to be anchored in the root of the
  411.       DNS tree, therefore two domains <code>.MyDomain.com</code> and
  412.       <code>.mydomain.com.</code> (note the trailing period) are considered
  413.       equal. Since a domain comparison does not involve a DNS lookup, it is much
  414.       more efficient than subnet comparison.</p>
  415.     </div></dd>
  416.  
  417.     
  418.     <dt><var><a name="subnet" id="subnet">SubNet</a></var></dt>
  419.     <dd>
  420.     <p>A <dfn>SubNet</dfn> is a partially qualified internet address in
  421.     numeric (dotted quad) form, optionally followed by a slash and the netmask,
  422.     specified as the number of significant bits in the <var>SubNet</var>. It is
  423.     used to represent a subnet of hosts which can be reached over a common
  424.     network interface. In the absence of the explicit net mask it is assumed
  425.     that omitted (or zero valued) trailing digits specify the mask. (In this
  426.     case, the netmask can only be multiples of 8 bits wide.) Examples:</p>
  427.  
  428.     <dl>
  429.     <dt><code>192.168</code> or <code>192.168.0.0</code></dt>
  430.     <dd>the subnet 192.168.0.0 with an implied netmask of 16 valid bits
  431.     (sometimes used in the netmask form <code>255.255.0.0</code>)</dd>
  432.     <dt><code>192.168.112.0/21</code></dt>
  433.     <dd>the subnet <code>192.168.112.0/21</code> with a netmask of 21
  434.     valid bits (also used in the form <code>255.255.248.0</code>)</dd>
  435.     </dl>
  436.  
  437.     <p>As a degenerate case, a <em>SubNet</em> with 32 valid bits is the
  438.     equivalent to an <var><a href="#ipadr">IPAddr</a></var>, while a <var>SubNet</var> with zero
  439.     valid bits (<em>e.g.</em>, 0.0.0.0/0) is the same as the constant
  440.     <var>_Default_</var>, matching any IP address.</p></dd>
  441.  
  442.     
  443.     <dt><var><a name="ipaddr" id="ipaddr">IPAddr</a></var></dt>
  444.     <dd>
  445.     <p>A <dfn>IPAddr</dfn> represents a fully qualified internet address in
  446.     numeric (dotted quad) form. Usually, this address represents a host, but
  447.     there need not necessarily be a DNS domain name connected with the
  448.     address.</p>
  449.     <div class="example"><h3>Example</h3><p><code>
  450.       192.168.123.7
  451.     </code></p></div>
  452.     
  453.     <div class="note"><h3>Note</h3>
  454.       <p>An <var>IPAddr</var> does not need to be resolved by the DNS system, so
  455.       it can result in more effective apache performance.</p>
  456.     </div></dd>
  457.  
  458.     
  459.     <dt><var><a name="hostname" id="hostname">Hostname</a></var></dt>
  460.     <dd>
  461.     <p>A <dfn>Hostname</dfn> is a fully qualified DNS domain name which can
  462.     be resolved to one or more <var><a href="#ipaddr">IPAddrs</a></var> via the
  463.     DNS domain name service. It represents a logical host (in contrast to
  464.     <var><a href="#domain">Domain</a></var>s, see above) and must be resolvable
  465.     to at least one <var><a href="#ipaddr">IPAddr</a></var> (or often to a list
  466.     of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
  467.  
  468.     <div class="example"><h3>Examples</h3><p><code>
  469.       prep.ai.mit.edu<br />
  470.       www.apache.org
  471.     </code></p></div>
  472.  
  473.     <div class="note"><h3>Note</h3>
  474.       <p>In many situations, it is more effective to specify an <var><a href="#ipaddr">IPAddr</a></var> in place of a <var>Hostname</var> since a
  475.       DNS lookup can be avoided. Name resolution in Apache can take a remarkable
  476.       deal of time when the connection to the name server uses a slow PPP
  477.       link.</p>
  478.       <p><var>Hostname</var> comparisons are done without regard to the case,
  479.       and <var>Hostname</var>s are always assumed to be anchored in the root
  480.       of the DNS tree, therefore two hosts <code>WWW.MyDomain.com</code>
  481.       and <code>www.mydomain.com.</code> (note the trailing period) are
  482.       considered equal.</p>
  483.      </div></dd>
  484.     </dl>
  485.  
  486. <h3>See also</h3>
  487. <ul>
  488. <li><a href="../dns-caveats.html">DNS Issues</a></li>
  489. </ul>
  490. </div>
  491. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  492. <div class="directive-section"><h2><a name="Proxy" id="Proxy"><Proxy></a> <a name="proxy" id="proxy">Directive</a></h2>
  493. <table class="directive">
  494. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to proxied resources</td></tr>
  495. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Proxy <var>wildcard-url</var>> ...</Proxy></code></td></tr>
  496. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  497. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  498. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  499. </table>
  500.     <p>Directives placed in <code class="directive"><Proxy></code>
  501.     sections apply only to matching proxied content.  Shell-style wildcards are
  502.     allowed.</p>
  503.  
  504.     <p>For example, the following will allow only hosts in
  505.     <code>yournetwork.example.com</code> to access content via your proxy
  506.     server:</p>
  507.  
  508.     <div class="example"><p><code>
  509.       <Proxy *><br />
  510.       <span class="indent">
  511.         Order Deny,Allow<br />
  512.         Deny from all<br />
  513.         Allow from yournetwork.example.com<br />
  514.       </span>
  515.       </Proxy>
  516.     </code></p></div>
  517.  
  518.     <p>The following example will process all files in the <code>foo</code>
  519.     directory of <code>example.com</code> through the <code>INCLUDES</code>
  520.     filter when they are sent through the proxy server:</p>
  521.  
  522.     <div class="example"><p><code>
  523.       <Proxy http://example.com/foo/*><br />
  524.       <span class="indent">
  525.         SetOutputFilter INCLUDES<br />
  526.       </span>
  527.       </Proxy>
  528.     </code></p></div>
  529.  
  530.  
  531. </div>
  532. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  533. <div class="directive-section"><h2><a name="ProxyBadHeader" id="ProxyBadHeader">ProxyBadHeader</a> <a name="proxybadheader" id="proxybadheader">Directive</a></h2>
  534. <table class="directive">
  535. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how to handle bad header lines in a
  536. response</td></tr>
  537. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBadHeader IsError|Ignore|StartBody</code></td></tr>
  538. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyBadHeader IsError</code></td></tr>
  539. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  540. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  541. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  542. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.44 and later</td></tr>
  543. </table>
  544.     <p>The <code class="directive">ProxyBadHeader</code> directive determines the
  545.     behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> if it receives syntactically invalid
  546.     header lines (<em>i.e.</em> containing no colon). The following arguments
  547.     are possible:</p>
  548.  
  549.     <dl>
  550.     <dt><code>IsError</code></dt>
  551.     <dd>Abort the request and end up with a 502 (Bad Gateway) response. This is
  552.     the default behaviour.</dd>
  553.  
  554.     <dt><code>Ignore</code></dt>
  555.     <dd>Treat bad header lines as if they weren't sent.</dd>
  556.  
  557.     <dt><code>StartBody</code></dt>
  558.     <dd>When receiving the first bad header line, finish reading the headers and
  559.     treat the remainder as body. This helps to work around buggy backend servers
  560.     which forget to insert an empty line between the headers and the body.</dd>
  561.     </dl>
  562.  
  563. </div>
  564. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  565. <div class="directive-section"><h2><a name="ProxyBlock" id="ProxyBlock">ProxyBlock</a> <a name="proxyblock" id="proxyblock">Directive</a></h2>
  566. <table class="directive">
  567. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Words, hosts, or domains that are banned from being
  568. proxied</td></tr>
  569. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBlock *|<var>word</var>|<var>host</var>|<var>domain</var>
  570. [<var>word</var>|<var>host</var>|<var>domain</var>] ...</code></td></tr>
  571. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  572. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  573. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  574. </table>
  575.     <p>The <code class="directive">ProxyBlock</code> directive specifies a list of
  576.     words, hosts and/or domains, separated by spaces.  HTTP, HTTPS, and
  577.     FTP document requests to sites whose names contain matched words,
  578.     hosts or domains are <em>blocked</em> by the proxy server. The proxy
  579.     module will also attempt to determine IP addresses of list items which
  580.     may be hostnames during startup, and cache them for match test as
  581.     well. That may slow down the startup time of the server.</p>
  582.  
  583.     <div class="example"><h3>Example</h3><p><code>
  584.       ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu
  585.     </code></p></div>
  586.  
  587.     <p><code>rocky.wotsamattau.edu</code> would also be matched if referenced by
  588.     IP address.</p>
  589.  
  590.     <p>Note that <code>wotsamattau</code> would also be sufficient to match
  591.     <code>wotsamattau.edu</code>.</p>
  592.  
  593.     <p>Note also that</p>
  594.  
  595.     <div class="example"><p><code>
  596.       ProxyBlock *
  597.     </code></p></div>
  598.  
  599.     <p>blocks connections to all sites.</p>
  600.  
  601. </div>
  602. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  603. <div class="directive-section"><h2><a name="ProxyDomain" id="ProxyDomain">ProxyDomain</a> <a name="proxydomain" id="proxydomain">Directive</a></h2>
  604. <table class="directive">
  605. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
  606. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</var></code></td></tr>
  607. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  608. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  609. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  610. </table>
  611.     <p>This directive is only useful for Apache proxy servers within
  612.     intranets. The <code class="directive">ProxyDomain</code> directive specifies
  613.     the default domain which the apache proxy server will belong to. If a
  614.     request to a host without a domain name is encountered, a redirection
  615.     response to the same host with the configured <var>Domain</var> appended
  616.     will be generated.</p>
  617.  
  618.     <div class="example"><h3>Example</h3><p><code>
  619.       ProxyRemote  *  http://firewall.mycompany.com:81<br />
  620.       NoProxy         .mycompany.com 192.168.112.0/21<br />
  621.       ProxyDomain     .mycompany.com
  622.     </code></p></div>
  623.  
  624. </div>
  625. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  626. <div class="directive-section"><h2><a name="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
  627. <table class="directive">
  628. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
  629. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
  630. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride Off</code></td></tr>
  631. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  632. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  633. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  634. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0 and later</td></tr>
  635. </table>
  636.     <p>This directive is useful for reverse-proxy setups, where you want to 
  637.     have a common look and feel on the error pages seen by the end user. 
  638.     This also allows for included files (via
  639.     <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>'s SSI) to get
  640.     the error code and act accordingly (default behavior would display
  641.     the error page of the proxied server, turning this on shows the SSI
  642.     Error message).</p>
  643.  
  644.     <p>This directive does not affect the processing of informational (1xx),
  645.     normal success (2xx), or redirect (3xx) responses.</p>
  646.  
  647. </div>
  648. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  649. <div class="directive-section"><h2><a name="ProxyFtpDirCharset" id="ProxyFtpDirCharset">ProxyFtpDirCharset</a> <a name="proxyftpdircharset" id="proxyftpdircharset">Directive</a></h2>
  650. <table class="directive">
  651. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the character set for proxied FTP listings</td></tr>
  652. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyFtpDirCharset <var>character set</var></code></td></tr>
  653. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyFtpDirCharset ISO-8859-1</code></td></tr>
  654. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  655. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  656. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  657. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.2.7 and later</td></tr>
  658. </table>
  659.     <p>The <code class="directive">ProxyFtpDirCharset</code> directive defines the
  660.     character set to be set for FTP directory listings in HTML generated by
  661.     <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>.</p>
  662.  
  663. </div>
  664. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  665. <div class="directive-section"><h2><a name="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
  666. <table class="directive">
  667. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
  668. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
  669. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</code></td></tr>
  670. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  671. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  672. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  673. </table>
  674.     <p>The <code class="directive">ProxyIOBufferSize</code> directive adjusts the size
  675.     of the internal buffer, which is used as a scratchpad for the data between
  676.     input and output. The size must be less or equal <code>8192</code>.</p>
  677.  
  678.     <p>In almost every case there's no reason to change that value.</p>
  679.  
  680. </div>
  681. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  682. <div class="directive-section"><h2><a name="ProxyMatch" id="ProxyMatch"><ProxyMatch></a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
  683. <table class="directive">
  684. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched 
  685. proxied resources</td></tr>
  686. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><ProxyMatch <var>regex</var>> ...</ProxyMatch></code></td></tr>
  687. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  688. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  689. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  690. </table>
  691.     <p>The <code class="directive"><ProxyMatch></code> directive is
  692.     identical to the <code class="directive"><a href="#proxy"><Proxy></a></code> directive, except it matches URLs
  693.     using <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expressions</a>.</p>
  694.  
  695. </div>
  696. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  697. <div class="directive-section"><h2><a name="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
  698. <table class="directive">
  699. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
  700. through</td></tr>
  701. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
  702. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards -1</code></td></tr>
  703. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  704. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  705. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  706. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0 and later;
  707.     default behaviour changed in 2.2.7</td></tr>
  708. </table>
  709.     <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
  710.     maximum number of proxies through which a request may pass, if there's no
  711.     <code>Max-Forwards</code> header supplied with the request. This may
  712.     be set to prevent infinite proxy loops, or a DoS attack.</p>
  713.  
  714.     <div class="example"><h3>Example</h3><p><code>
  715.       ProxyMaxForwards 15
  716.     </code></p></div>
  717.  
  718.     <p>Note that setting <code class="directive">ProxyMaxForwards</code> is a
  719.     violation of the HTTP/1.1 protocol (RFC2616), which forbids a Proxy
  720.     setting <code>Max-Forwards</code> if the Client didn't set it.
  721.     Earlier Apache versions would always set it.  A negative
  722.     <code class="directive">ProxyMaxForwards</code> value, including the
  723.     default -1, gives you protocol-compliant behaviour, but may
  724.     leave you open to loops.</p>
  725.  
  726. </div>
  727. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  728. <div class="directive-section"><h2><a name="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
  729. <table class="directive">
  730. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
  731. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var> <var>key=value</var> ...]] [nocanon]</code></td></tr>
  732. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  733. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  734. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  735. </table>
  736.     <p>This directive allows remote servers to be mapped into the space of
  737.     the local server; the local server does not act as a proxy in the
  738.     conventional sense, but appears to be a mirror of the remote
  739.     server. <var>path</var> is the name of a local virtual path; <var>url</var>
  740.     is a partial URL for the remote server and cannot include a query
  741.     string.</p>
  742.  
  743.     <div class="warning">The <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive should
  744.     usually be set <strong>off</strong> when using
  745.     <code class="directive">ProxyPass</code>.</div>
  746.  
  747.     <p>Suppose the local server has address <code>http://example.com/</code>;
  748.     then</p>
  749.  
  750.     <div class="example"><p><code>
  751.       ProxyPass /mirror/foo/ http://backend.example.com/
  752.     </code></p></div>
  753.  
  754.     <p>will cause a local request for
  755.     <code>http://example.com/mirror/foo/bar</code> to be internally converted
  756.     into a proxy request to <code>http://backend.example.com/bar</code>.</p>
  757.  
  758.     <p>The <code>!</code> directive is useful in situations where you don't want
  759.     to reverse-proxy a subdirectory, <em>e.g.</em></p>
  760.  
  761.     <div class="example"><p><code>
  762.       ProxyPass /mirror/foo/i !<br />
  763.       ProxyPass /mirror/foo http://backend.example.com
  764.     </code></p></div>
  765.  
  766.     <p>will proxy all requests to <code>/mirror/foo</code> to
  767.     <code>backend.example.com</code> <em>except</em> requests made to
  768.     <code>/mirror/foo/i</code>.</p>
  769.  
  770.     <div class="note"><h3>Note</h3>
  771.       <p>Order is important: exclusions must come <em>before</em> the
  772.       general <code class="directive">ProxyPass</code> directive.</p>
  773.     </div>
  774.  
  775.     <p>As of Apache 2.1, the ability to use pooled connections to a backend
  776.     server is available. Using the <code>key=value</code> parameters it is
  777.     possible to tune this connection pooling. The default for a <code>Hard
  778.     Maximum</code> for the number of connections is the number of threads per
  779.     process in the active MPM. In the Prefork MPM, this is always 1, while with
  780.     the Worker MPM it is controlled by the
  781.     <code class="directive">ThreadsPerChild</code>.</p>
  782.  
  783.     <p>Setting <code>min</code> will determine how many connections will always 
  784.     be open to the backend server. Upto the Soft Maximum or <code>smax</code> 
  785.     number of connections will be created on demand. Any connections above 
  786.     <code>smax</code> are subject to a time to live or <code>ttl</code>.  Apache
  787.     will never create more than the Hard Maximum or <code>max</code> connections
  788.     to the backend server.</p>
  789.  
  790.     <div class="example"><p><code>
  791.         ProxyPass /example http://backend.example.com smax=5 max=20 ttl=120 retry=300
  792.     </code></p></div>
  793.  
  794.     <table>
  795.     <tr><th>Parameter</th>
  796.         <th>Default</th>
  797.         <th>Description</th></tr>
  798.     <tr><td>min</td>
  799.         <td>0</td>
  800.         <td>Minumum number of connections that will always
  801.             be open to the backend server.</td></tr>
  802.     <tr><td>max</td>
  803.         <td>1...n</td>
  804.         <td>Hard Maximum number of connections that will be
  805.     allowed to the backend server. The default for a Hard Maximum
  806.     for the number of connections is the number of threads per process in the 
  807.     active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM
  808.     it is controlled by the <code class="directive">ThreadsPerChild</code>.
  809.     Apache will never create more than the Hard Maximum connections
  810.     to the backend server.</td></tr>
  811.     <tr><td>smax</td>
  812.         <td>max</td>
  813.         <td>Upto the Soft Maximum
  814.     number of connections will be created on demand. Any connections above 
  815.     <code>smax</code> are subject to a time to live or <code>ttl</code>.
  816.     </td></tr>
  817.     <tr><td>acquire</td>
  818.         <td>-</td>
  819.         <td>If set this will be the maximum time to wait for a free
  820.     connection in the connection pool. If there are no free connections
  821.     in the pool the Apache will return <code>SERVER_BUSY</code> status to
  822.     the client.
  823.     </td></tr>
  824.     <tr><td>flushpackets</td>
  825.         <td>off</td>
  826.         <td>Determines whether the proxy module will auto-flush the output
  827.         brigade after each "chunk" of data. 'off' means that it will flush
  828.         only when needed, 'on' means after each chunk is sent and
  829.         'auto' means poll/wait for a period of time and flush if
  830.         no input has been received for 'flushwait' milliseconds.
  831.         Currently this is in effect only for AJP.
  832.     </td></tr>
  833.     <tr><td>flushwait</td>
  834.         <td>10</td>
  835.         <td>The time to wait for additional input, in milliseconds, before
  836.         flushing the output brigade if 'flushpackets' is 'auto'.
  837.     </td></tr>
  838.     <tr><td>keepalive</td>
  839.         <td>Off</td>
  840.         <td>This parameter should be used when you have a firewall between your
  841.     Apache and the backend server, who tend to drop inactive connections.
  842.     This flag will tell the Operating System to send <code>KEEP_ALIVE</code>
  843.     messages on inactive connections (interval depends on global OS settings,
  844.     generally 120ms), and thus prevent the firewall to drop the connection.
  845.     To enable keepalive set this property value to <code>On</code>. 
  846.     </td></tr>
  847.     <tr><td>lbset</td>
  848.         <td>0</td>
  849.         <td>Sets the load balancer cluster set that the worker is a member
  850.          of. The load balancer will try all members of a lower numbered
  851.          lbset before trying higher numbered ones.
  852.     </td></tr>
  853.     <tr><td>ping</td>
  854.         <td>0</td>
  855.         <td>Ping property tells webserver to send a <code>CPING</code>
  856.         request on ajp13 connection before forwarding a request.
  857.         The parameter is the delay in seconds to wait for the
  858.         <code>CPONG</code> reply.
  859.         This features has been added to avoid problem with hung and
  860.         busy Tomcat's and require ajp13 ping/pong support which has
  861.         been implemented on Tomcat 3.3.2+, 4.1.28+ and 5.0.13+.
  862.         This will increase the network traffic during the normal operation
  863.         which could be an issue, but it will lower the
  864.         traffic in case some of the cluster nodes are down or busy.
  865.         Currently this has an effect only for AJP.
  866.     </td></tr>
  867.     <tr><td>loadfactor</td>
  868.         <td>1</td>
  869.         <td>Worker load factor. Used with BalancerMember.
  870.          It is a number between 1 and 100 and defines the normalized weighted
  871.          load applied to the worker.
  872.     </td></tr>
  873.     <tr><td>redirect</td>
  874.         <td>-</td>
  875.         <td>Redirection Route of the worker. This value is usually
  876.         set dynamically to enable safe removal of the node from
  877.         the cluster. If set all requests without session id will be
  878.         redirected to the BalancerMember that has route parametar
  879.         equal as this value.
  880.     </td></tr>
  881.     <tr><td>retry</td>
  882.         <td>60</td>
  883.         <td>Connection pool worker retry timeout in seconds.
  884.     If the connection pool worker to the backend server is in the error state,
  885.     Apache will not forward any requests to that server until the timeout
  886.     expires. This enables to shut down the backend server for maintenance,
  887.     and bring it back online later. A value of 0 means always retry workers
  888.     in an error state with no timeout.
  889.     </td></tr>
  890.     <tr><td>route</td>
  891.         <td>-</td>
  892.         <td>Route of the worker when used inside load balancer.
  893.         The route is a value appended to session id.
  894.     </td></tr>
  895.     <tr><td>status</td>
  896.         <td>-</td>
  897.         <td>Single letter value defining the initial status of
  898.         this worker: 'D' is disabled, 'S' is stopped, 'I' is ignore-errors,
  899.     'H' is hot-standby and 'E' is in an error state. Status 
  900.     can be set (which is the default) by prepending with '+' or 
  901.         cleared by prepending with '-'.
  902.         Thus, a setting of 'S-E' sets this worker to Stopped and
  903.         clears the in-error flag.
  904.     </td></tr>
  905.     <tr><td>timeout</td>
  906.         <td><code class="directive">Timeout</code></td>
  907.         <td>Connection timeout in seconds.
  908.         If not set the Apache will wait until the free connection
  909.         is available. This directive is used for limiting the number
  910.         of connections to the backend server together with <code>max</code>
  911.         parameter.
  912.     </td></tr>
  913.     <tr><td>ttl</td>
  914.         <td>-</td>
  915.         <td>Time To Live for the inactive connections above the
  916.         <code>smax</code> connections in seconds. Apache will close all
  917.         connections that has not been used inside that time period.
  918.     </td></tr>
  919.  
  920.     </table>
  921.  
  922.     <p>If the Proxy directive scheme starts with the
  923.     <code>balancer://</code> then a virtual worker that does not really
  924.     communicate with the backend server will be created. Instead it is responsible
  925.     for the management of several "real" workers. In that case the special set of
  926.     parameters can be add to this virtual worker. See <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
  927.     for more information about how the balancer works.
  928.     </p>
  929.     <table>
  930.     <tr><th>Parameter</th>
  931.         <th>Default</th>
  932.         <th>Description</th></tr>
  933.     <tr><td>lbmethod</td>
  934.         <td>byrequests</td>
  935.         <td>Balancer load-balance method. Select the load-balancing scheduler
  936.         method to use. Either <code>byrequests</code>, to perform weighted
  937.         request counting or <code>bytraffic</code>, to perform weighted
  938.         traffic byte count balancing. Default is <code>byrequests</code>.
  939.     </td></tr>
  940.     <tr><td>maxattempts</td>
  941.         <td>1</td>
  942.         <td>Maximum number of failover attempts before giving up. 
  943.     </td></tr>
  944.     <tr><td>nofailover</td>
  945.         <td>Off</td>
  946.         <td>If set to <code>On</code> the session will break if the worker is in
  947.         error state or disabled. Set this value to On if backend servers do not
  948.         support session replication.
  949.     </td></tr>
  950.     <tr><td>stickysession</td>
  951.         <td>-</td>
  952.         <td>Balancer sticky session name. The value is usually set to something
  953.         like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
  954.         and it depends on the backend application server that support sessions.
  955.         If the backend application server uses different name for cookies
  956.         and url encoded id (like servlet containers) use | to to separate them.
  957.         The first part is for the cookie the second for the path.
  958.     </td></tr>
  959.     <tr><td>timeout</td>
  960.         <td>0</td>
  961.         <td>Balancer timeout in seconds. If set this will be the maximum time
  962.         to wait for a free worker. Default is not to wait. 
  963.     </td></tr>
  964.     
  965.     </table>
  966.     <p>A sample balancer setup</p>
  967.     <div class="example"><p><code>
  968.       ProxyPass /special-area http://special.example.com/ smax=5 max=10<br />
  969.       ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On<br />
  970.       <Proxy balancer://mycluster><br />
  971.       <span class="indent">
  972.         BalancerMember http://1.2.3.4:8009<br />
  973.         BalancerMember http://1.2.3.5:8009 smax=10<br />
  974.         # Less powerful server, don't send as many requests there<br />
  975.         BalancerMember http://1.2.3.6:8009 smax=1 loadfactor=20<br />
  976.       </span>
  977.       </Proxy>
  978.     </code></p></div>
  979.  
  980.     <p>Setting up a hot-standby, that will only be used if no other
  981.      members are available</p>
  982.     <div class="example"><p><code>
  983.       ProxyPass / balancer://hotcluster/ <br />
  984.       <Proxy balancer://hotcluster><br />
  985.       <span class="indent">
  986.         BalancerMember http://1.2.3.4:8009 loadfactor=1<br />
  987.         BalancerMember http://1.2.3.5:8009 loadfactor=2<br />
  988.         # The below is the hot standby<br />
  989.         BalancerMember http://1.2.3.6:8009 status=+H<br />
  990.         ProxySet lbmethod=bytraffic
  991.       </span>
  992.       </Proxy>
  993.     </code></p></div>
  994.  
  995.     <p>Normally, mod_proxy will canonicalise ProxyPassed URLs.
  996.     But this may be incompatible with some backends, particularly those
  997.     that make use of <var>PATH_INFO</var>.  The optional <var>nocanon</var>
  998.     keyword suppresses this, and passes the URL path "raw" to the
  999.     backend.  Note that may affect the security of your backend, as it
  1000.     removes the normal limited protection against URL-based attacks
  1001.     provided by the proxy.</p>
  1002.  
  1003.     <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is omitted and the local
  1004.     directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
  1005.  
  1006.     <p>If you require a more flexible reverse-proxy configuration, see the
  1007.     <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
  1008.     <code>[P]</code> flag.</p>
  1009.  
  1010. </div>
  1011. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1012. <div class="directive-section"><h2><a name="ProxyPassMatch" id="ProxyPassMatch">ProxyPassMatch</a> <a name="proxypassmatch" id="proxypassmatch">Directive</a></h2>
  1013. <table class="directive">
  1014. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space using regular expressions</td></tr>
  1015. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassMatch [<var>regex</var>] !|<var>url</var> [<var>key=value</var>
  1016.     <var>[key=value</var> ...]]</code></td></tr>
  1017. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1018. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1019. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1020. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>available in Apache 2.2.5 and later</td></tr>
  1021. </table>
  1022.     <p>This directive is equivalent to <code class="directive"><a href="#proxypass">ProxyPass</a></code>,
  1023.        but makes use of regular expressions, instead of simple prefix matching. The
  1024.        supplied regular expression is matched against the <var>url</var>, and if it
  1025.        matches, the server will substitute any parenthesized matches into the given
  1026.        string and use it as a new <var>url</var>.</p>
  1027.  
  1028.     <p>Suppose the local server has address <code>http://example.com/</code>;
  1029.     then</p>
  1030.  
  1031.     <div class="example"><p><code>
  1032.       ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com$1
  1033.     </code></p></div>
  1034.  
  1035.     <p>will cause a local request for
  1036.     <code>http://example.com/mirror/foo/bar.gif</code> to be internally converted
  1037.     into a proxy request to <code>http://backend.example.com/foo/bar.gif</code>.</p>
  1038.  
  1039.     <p>The <code>!</code> directive is useful in situations where you don't want
  1040.     to reverse-proxy a subdirectory.</p>
  1041.  
  1042. </div>
  1043. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1044. <div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
  1045. <table class="directive">
  1046. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
  1047. proxied server</td></tr>
  1048. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var></code></td></tr>
  1049. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1050. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1051. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1052. </table>
  1053.     <p>This directive lets Apache adjust the URL in the <code>Location</code>,
  1054.     <code>Content-Location</code> and <code>URI</code> headers on HTTP redirect
  1055.     responses. This is essential when Apache is used as a reverse proxy to avoid
  1056.     by-passing the reverse proxy because of HTTP redirects on the backend
  1057.     servers which stay behind the reverse proxy.</p>
  1058.  
  1059.     <p>Only the HTTP response headers specifically mentioned above
  1060.     will be rewritten.  Apache will not rewrite other response
  1061.     headers, nor will it rewrite URL references inside HTML pages.
  1062.     This means that if the proxied content contains absolute URL
  1063.     references, they will by-pass the proxy.  A third-party module
  1064.     that will look inside the HTML and rewrite URL references is Nick
  1065.     Kew's <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.</p>
  1066.  
  1067.     <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
  1068.     partial URL for the remote server - the same way they are used for the
  1069.     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
  1070.  
  1071.     <p>For example, suppose the local server has address
  1072.     <code>http://example.com/</code>; then</p>
  1073.  
  1074.     <div class="example"><p><code>
  1075.       ProxyPass         /mirror/foo/ http://backend.example.com/<br />
  1076.       ProxyPassReverse  /mirror/foo/ http://backend.example.com/<br />
  1077.       ProxyPassReverseCookieDomain  backend.example.com  public.example.com<br />
  1078.       ProxyPassReverseCookiePath  /  /mirror/foo/
  1079.     </code></p></div>
  1080.  
  1081.     <p>will not only cause a local request for the
  1082.     <code>http://example.com/mirror/foo/bar</code> to be internally converted
  1083.     into a proxy request to <code>http://backend.example.com/bar</code>
  1084.     (the functionality <code>ProxyPass</code> provides here). It also takes care
  1085.     of redirects the server <code>backend.example.com</code> sends: when
  1086.     <code>http://backend.example.com/bar</code> is redirected by him to
  1087.     <code>http://backend.example.com/quux</code> Apache adjusts this to
  1088.     <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
  1089.     redirect response to the client. Note that the hostname used for
  1090.     constructing the URL is chosen in respect to the setting of the <code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> directive.</p>
  1091.  
  1092.     <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
  1093.     also be used in conjunction with the proxy pass-through feature
  1094.     (<code>RewriteRule ...  [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
  1095.     because it doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
  1096.  
  1097.     <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is omitted and the local
  1098.     directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
  1099.  
  1100. </div>
  1101. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1102. <div class="directive-section"><h2><a name="ProxyPassReverseCookieDomain" id="ProxyPassReverseCookieDomain">ProxyPassReverseCookieDomain</a> <a name="proxypassreversecookiedomain" id="proxypassreversecookiedomain">Directive</a></h2>
  1103. <table class="directive">
  1104. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Domain string in Set-Cookie headers from a reverse-
  1105. proxied server</td></tr>
  1106. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookieDomain <var>internal-domain</var> <var>public-domain</var></code></td></tr>
  1107. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1108. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1109. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1110. </table>
  1111. <p>Usage is basically similar to
  1112. <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
  1113. rewriting headers that are a URL, this rewrites the <code>domain</code>
  1114. string in <code>Set-Cookie</code> headers.</p>
  1115.  
  1116. </div>
  1117. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1118. <div class="directive-section"><h2><a name="ProxyPassReverseCookiePath" id="ProxyPassReverseCookiePath">ProxyPassReverseCookiePath</a> <a name="proxypassreversecookiepath" id="proxypassreversecookiepath">Directive</a></h2>
  1119. <table class="directive">
  1120. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Path string in Set-Cookie headers from a reverse-
  1121. proxied server</td></tr>
  1122. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookiePath <var>internal-path</var> <var>public-path</var></code></td></tr>
  1123. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1124. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1125. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1126. </table>
  1127. <p>Usage is basically similar to
  1128. <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
  1129. rewriting headers that are a URL, this rewrites the <code>path</code>
  1130. string in <code>Set-Cookie</code> headers.</p>
  1131.  
  1132. </div>
  1133. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1134. <div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
  1135. <table class="directive">
  1136. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
  1137. request</td></tr>
  1138. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
  1139. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
  1140. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1141. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1142. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1143. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later.</td></tr>
  1144. </table>
  1145.     <p>When enabled, this option will pass the Host: line from the incoming
  1146.     request to the proxied host, instead of the hostname specified in the
  1147.     <code class="directive">ProxyPass</code> line.</p>
  1148.  
  1149.     <p>This option should normally be turned <code>Off</code>. It is mostly 
  1150.     useful in special configurations like proxied mass name-based virtual
  1151.     hosting, where the original Host header needs to be evaluated by the
  1152.     backend server.</p>
  1153.  
  1154. </div>
  1155. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1156. <div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
  1157. <table class="directive">
  1158. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
  1159. connections</td></tr>
  1160. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
  1161. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
  1162. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1163. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1164. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1165. </table>
  1166.     <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
  1167.     explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
  1168.     for increased throughput. It has to be greater than <code>512</code> or set
  1169.     to <code>0</code> to indicate that the system's default buffer size should
  1170.     be used.</p>
  1171.  
  1172.     <div class="example"><h3>Example</h3><p><code>
  1173.       ProxyReceiveBufferSize 2048
  1174.     </code></p></div>
  1175.  
  1176. </div>
  1177. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1178. <div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
  1179. <table class="directive">
  1180. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
  1181. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
  1182. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1183. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1184. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1185. </table>
  1186.     <p>This defines remote proxies to this proxy. <var>match</var> is either the
  1187.     name of a URL-scheme that the remote server supports, or a partial URL
  1188.     for which the remote server should be used, or <code>*</code> to indicate
  1189.     the server should be contacted for all requests. <var>remote-server</var> is
  1190.     a partial URL for the remote server. Syntax:</p>
  1191.  
  1192.     <div class="example"><p><code>
  1193.       <dfn>remote-server</dfn> =
  1194.           <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
  1195.     </code></p></div>
  1196.  
  1197.     <p><var>scheme</var> is effectively the protocol that should be used to
  1198.     communicate with the remote server; only <code>http</code> is supported by
  1199.     this module.</p>
  1200.  
  1201.     <div class="example"><h3>Example</h3><p><code>
  1202.       ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000<br />
  1203.       ProxyRemote * http://cleversite.com<br />
  1204.       ProxyRemote ftp http://ftpproxy.mydomain.com:8080
  1205.     </code></p></div>
  1206.  
  1207.     <p>In the last example, the proxy will forward FTP requests, encapsulated
  1208.     as yet another HTTP proxy request, to another proxy which can handle
  1209.     them.</p>
  1210.  
  1211.     <p>This option also supports reverse proxy configuration - a backend
  1212.     webserver can be embedded within a virtualhost URL space even if that
  1213.     server is hidden by another forward proxy.</p>
  1214.  
  1215. </div>
  1216. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1217. <div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
  1218. <table class="directive">
  1219. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
  1220. expressions</td></tr>
  1221. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
  1222. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1223. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1224. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1225. </table>
  1226.     <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
  1227.     <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
  1228.     first argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
  1229.     match against the requested URL.</p>
  1230.  
  1231. </div>
  1232. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1233. <div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
  1234. <table class="directive">
  1235. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
  1236. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
  1237. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
  1238. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1239. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1240. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1241. </table>
  1242.     <p>This allows or prevents Apache from functioning as a forward proxy
  1243.     server. (Setting ProxyRequests to <code>Off</code> does not disable use of
  1244.     the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>
  1245.  
  1246.     <p>In a typical reverse proxy configuration, this option should be set to
  1247.     <code>Off</code>.</p>
  1248.  
  1249.     <p>In order to get the functionality of proxying HTTP or FTP sites, you
  1250.     need also <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> or <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>
  1251.     (or both) present in the server.</p>
  1252.  
  1253.     <div class="warning"><h3>Warning</h3>
  1254.       <p>Do not enable proxying with <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> until you have <a href="#access">secured your server</a>.  Open proxy servers are dangerous
  1255.       both to your network and to the Internet at large.</p>
  1256.     </div>
  1257.  
  1258. </div>
  1259. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1260. <div class="directive-section"><h2><a name="ProxySet" id="ProxySet">ProxySet</a> <a name="proxyset" id="proxyset">Directive</a></h2>
  1261. <table class="directive">
  1262. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set various Proxy balancer or member parameters</td></tr>
  1263. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySet <var>url</var> <var>key=value [key=value ...]</var></code></td></tr>
  1264. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
  1265. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1266. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1267. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>ProxySet is only available in Apache 2.2
  1268.     and later.</td></tr>
  1269. </table>
  1270.     <p>This directive is used as an alternate method of setting any of the
  1271.     parameters available to Proxy balancers and workers normally done via the
  1272.     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive. If used
  1273.     within a <code><Proxy <var>balancer url|worker url</var>></code>
  1274.     container directive, the <var>url</var> argument is not required. As a side
  1275.     effect the respective balancer or worker gets created. This can be useful
  1276.     when doing reverse proxying via a
  1277.     <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> instead of a
  1278.     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
  1279.  
  1280.     <div class="example"><p><code>
  1281.       <Proxy balancer://hotcluster><br />
  1282.       <span class="indent">
  1283.         BalancerMember http://www2.example.com:8009 loadfactor=1<br />
  1284.         BalancerMember http://www3.example.com:8009 loadfactor=2<br />
  1285.         ProxySet lbmethod=bytraffic<br />
  1286.       </span>
  1287.       </Proxy>
  1288.     </code></p></div>
  1289.  
  1290.     <div class="example"><p><code>
  1291.       <Proxy http://backend><br />
  1292.       <span class="indent">
  1293.         ProxySet keepalive=On<br />
  1294.       </span>
  1295.       </Proxy>
  1296.     </code></p></div>
  1297.  
  1298.     <div class="example"><p><code>
  1299.         ProxySet balancer://foo lbmethod=bytraffic timeout=15
  1300.     </code></p></div>
  1301.  
  1302.     <div class="example"><p><code>
  1303.         ProxySet ajp://backend:7001 timeout=15
  1304.     </code></p></div>
  1305.  
  1306.    <div class="warning"><h3>Warning</h3>
  1307.       <p>Keep in mind that the same parameter key can have a different meaning
  1308.       depending whether it is applied to a balancer or a worker as shown by the two
  1309.       examples above regarding timeout.</p>
  1310.    </div>
  1311.  
  1312.  
  1313. </div>
  1314. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1315. <div class="directive-section"><h2><a name="ProxyStatus" id="ProxyStatus">ProxyStatus</a> <a name="proxystatus" id="proxystatus">Directive</a></h2>
  1316. <table class="directive">
  1317. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Show Proxy LoadBalancer status in mod_status</td></tr>
  1318. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyStatus Off|On|Full</code></td></tr>
  1319. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyStatus Off</code></td></tr>
  1320. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1321. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1322. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1323. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2 and later</td></tr>
  1324. </table>
  1325.     <p>This directive determines whether or not proxy
  1326.     loadbalancer status data is displayed via the <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>
  1327.     server-status page.</p>
  1328.     <div class="note"><h3>Note</h3>
  1329.       <p><strong>Full</strong> is synonymous with <strong>On</strong></p>
  1330.     </div>
  1331.  
  1332.  
  1333. </div>
  1334. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1335. <div class="directive-section"><h2><a name="ProxyTimeout" id="ProxyTimeout">ProxyTimeout</a> <a name="proxytimeout" id="proxytimeout">Directive</a></h2>
  1336. <table class="directive">
  1337. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network timeout for proxied requests</td></tr>
  1338. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyTimeout <var>seconds</var></code></td></tr>
  1339. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyTimeout 300</code></td></tr>
  1340. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1341. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1342. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1343. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later</td></tr>
  1344. </table>
  1345.     <p>This directive allows a user to specifiy a timeout on proxy requests.
  1346.     This is useful when you have a slow/buggy appserver which hangs, and you
  1347.     would rather just return a timeout and fail gracefully instead of waiting
  1348.     however long it takes the server to return.</p>
  1349.  
  1350. </div>
  1351. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1352. <div class="directive-section"><h2><a name="ProxyVia" id="ProxyVia">ProxyVia</a> <a name="proxyvia" id="proxyvia">Directive</a></h2>
  1353. <table class="directive">
  1354. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Information provided in the <code>Via</code> HTTP response
  1355. header for proxied requests</td></tr>
  1356. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyVia On|Off|Full|Block</code></td></tr>
  1357. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyVia Off</code></td></tr>
  1358. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1359. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  1360. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
  1361. </table>
  1362.     <p>This directive controls the use of the <code>Via:</code> HTTP
  1363.     header by the proxy. Its intended use is to control the flow of
  1364.     proxy requests along a chain of proxy servers.  See <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> (HTTP/1.1), section
  1365.     14.45 for an explanation of <code>Via:</code> header lines.</p>
  1366.  
  1367.     <ul>
  1368.     <li>If set to <code>Off</code>, which is the default, no special processing
  1369.     is performed. If a request or reply contains a <code>Via:</code> header,
  1370.     it is passed through unchanged.</li>
  1371.  
  1372.     <li>If set to <code>On</code>, each request and reply will get a
  1373.     <code>Via:</code> header line added for the current host.</li>
  1374.  
  1375.     <li>If set to <code>Full</code>, each generated <code>Via:</code> header
  1376.     line will additionally have the Apache server version shown as a
  1377.     <code>Via:</code> comment field.</li>
  1378.  
  1379.     <li>If set to <code>Block</code>, every proxy request will have all its
  1380.     <code>Via:</code> header lines removed. No new <code>Via:</code> header will
  1381.     be generated.</li>
  1382.     </ul>
  1383.  
  1384. </div>
  1385. </div>
  1386. <div class="bottomlang">
  1387. <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English"> en </a> |
  1388. <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  1389. </div><div id="footer">
  1390. <p class="apache">Copyright 2007 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
  1391. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  1392. </body></html>