⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod_proxy.html.en

📁 Apache2.2.4 with OpenSSL 0.9.8e 提供HTTP及HTTPS服务。 带QuickUsage
💻 EN
📖 第 1 页 / 共 5 页
字号:
        BalancerMember http://1.2.3.6:8009 status=+H<br />
        ProxySet lbmethod=bytraffic
      </span>
      &lt;/Proxy&gt;
    </code></p></div>

    
    <p>When used inside a <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> section, the first argument is omitted and the local
    directory is obtained from the <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>.</p>

    <p>If you require a more flexible reverse-proxy configuration, see the
    <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
    <code>[P]</code> flag.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
proxied server</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
    <p>This directive lets Apache adjust the URL in the <code>Location</code>,
    <code>Content-Location</code> and <code>URI</code> headers on HTTP redirect
    responses. This is essential when Apache is used as a reverse proxy to avoid
    by-passing the reverse proxy because of HTTP redirects on the backend
    servers which stay behind the reverse proxy.</p>

    <p>Only the HTTP response headers specifically mentioned above
    will be rewritten.  Apache will not rewrite other response
    headers, nor will it rewrite URL references inside HTML pages.
    This means that if the proxied content contains absolute URL
    references, they will by-pass the proxy.  A third-party module
    that will look inside the HTML and rewrite URL references is Nick
    Kew's <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.</p>

    <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
    partial URL for the remote server - the same way they are used for the
    <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>

    <p>For example, suppose the local server has address
    <code>http://example.com/</code>; then</p>

    <div class="example"><p><code>
      ProxyPass         /mirror/foo/ http://backend.example.com/<br />
      ProxyPassReverse  /mirror/foo/ http://backend.example.com/<br />
      ProxyPassReverseCookieDomain  backend.example.com  public.example.com<br />
      ProxyPassReverseCookiePath  /  /mirror/foo/
    </code></p></div>

    <p>will not only cause a local request for the
    <code>http://example.com/mirror/foo/bar</code> to be internally converted
    into a proxy request to <code>http://backend.example.com/bar</code>
    (the functionality <code>ProxyPass</code> provides here). It also takes care
    of redirects the server <code>backend.example.com</code> sends: when
    <code>http://backend.example.com/bar</code> is redirected by him to
    <code>http://backend.example.com/quux</code> Apache adjusts this to
    <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
    redirect response to the client. Note that the hostname used for
    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>

    <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
    also be used in conjunction with the proxy pass-through feature
    (<code>RewriteRule ...  [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
    because it doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>

    <p>When used inside a <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> section, the first argument is omitted and the local
    directory is obtained from the <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyPassReverseCookieDomain" id="ProxyPassReverseCookieDomain">ProxyPassReverseCookieDomain</a> <a name="proxypassreversecookiedomain" id="proxypassreversecookiedomain">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Domain string in Set-Cookie headers from a reverse-
proxied server</td></tr>
<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>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
<p>Usage is basically similar to
<code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
rewriting headers that are a URL, this rewrites the <code>domain</code>
string in <code>Set-Cookie</code> headers.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyPassReverseCookiePath" id="ProxyPassReverseCookiePath">ProxyPassReverseCookiePath</a> <a name="proxypassreversecookiepath" id="proxypassreversecookiepath">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Path string in Set-Cookie headers from a reverse-
proxied server</td></tr>
<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>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
<p>Usage is basically similar to
<code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
rewriting headers that are a URL, this rewrites the <code>path</code>
string in <code>Set-Cookie</code> headers.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
request</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later.</td></tr>
</table>
    <p>When enabled, this option will pass the Host: line from the incoming
    request to the proxied host, instead of the hostname specified in the
    <code class="directive">ProxyPass</code> line.</p>

    <p>This option should normally be turned <code>Off</code>. It is mostly 
    useful in special configurations like proxied mass name-based virtual
    hosting, where the original Host header needs to be evaluated by the
    backend server.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
connections</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
    <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
    explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
    for increased throughput. It has to be greater than <code>512</code> or set
    to <code>0</code> to indicate that the system's default buffer size should
    be used.</p>

    <div class="example"><h3>Example</h3><p><code>
      ProxyReceiveBufferSize 2048
    </code></p></div>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
    <p>This defines remote proxies to this proxy. <var>match</var> is either the
    name of a URL-scheme that the remote server supports, or a partial URL
    for which the remote server should be used, or <code>*</code> to indicate
    the server should be contacted for all requests. <var>remote-server</var> is
    a partial URL for the remote server. Syntax:</p>

    <div class="example"><p><code>
      <dfn>remote-server</dfn> =
          <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
    </code></p></div>

    <p><var>scheme</var> is effectively the protocol that should be used to
    communicate with the remote server; only <code>http</code> is supported by
    this module.</p>

    <div class="example"><h3>Example</h3><p><code>
      ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000<br />
      ProxyRemote * http://cleversite.com<br />
      ProxyRemote ftp http://ftpproxy.mydomain.com:8080
    </code></p></div>

    <p>In the last example, the proxy will forward FTP requests, encapsulated
    as yet another HTTP proxy request, to another proxy which can handle
    them.</p>

    <p>This option also supports reverse proxy configuration - a backend
    webserver can be embedded within a virtualhost URL space even if that
    server is hidden by another forward proxy.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
expressions</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
    <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
    <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
    first argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
    match against the requested URL.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
</table>
    <p>This allows or prevents Apache from functioning as a forward proxy
    server. (Setting ProxyRequests to <code>Off</code> does not disable use of
    the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>

    <p>In a typical reverse proxy configuration, this option should be set to
    <code>Off</code>.</p>

    <p>In order t

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -