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

📄 mod_proxy.html.en

📁 Apache 2.0.63 is the current stable version of the 2.0 series, and is recommended over any previous
💻 EN
📖 第 1 页 / 共 5 页
字号:
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</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 directive is only useful for Apache proxy servers within
    intranets. The <code class="directive">ProxyDomain</code> directive specifies
    the default domain which the apache proxy server will belong to. If a
    request to a host without a domain name is encountered, a redirection
    response to the same host with the configured <var>Domain</var> appended
    will be generated.</p>

    <div class="example"><h3>Example</h3><p><code>
      ProxyRemote  *  http://firewall.mycompany.com:81<br />
      NoProxy         .mycompany.com 192.168.112.0/21<br />
      ProxyDomain     .mycompany.com
    </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="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride 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 version 2.0 and later</td></tr>
</table>
    <p>This directive is useful for reverse-proxy setups, where you want to 
    have a common look and feel on the error pages seen by the end user. 
    This also allows for included files (via mod_include's SSI) to get
    the error code and act accordingly (default behavior would display
    the error page of the proxied server, turning this on shows the SSI
    Error message).</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="ProxyFtpDirCharset" id="ProxyFtpDirCharset">ProxyFtpDirCharset</a> <a name="proxyftpdircharset" id="proxyftpdircharset">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the character set for proxied FTP listings</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyFtpDirCharset <var>character set</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyFtpDirCharset ISO-8859-1</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>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.62 and later</td></tr>
</table>
    <p>The <code class="directive">ProxyFtpDirCharset</code> directive defines the
    character set to be set for FTP directory listings in HTML generated by
    <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</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="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</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">ProxyIOBufferSize</code> directive adjusts the size
    of the internal buffer, which is used as a scratchpad for the data between
    input and output. The size must be less or equal <code>8192</code>.</p>

    <p>In almost every case there's no reason to change that value.</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="ProxyMatch" id="ProxyMatch">&lt;ProxyMatch&gt;</a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched 
proxied resources</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;ProxyMatch <var>regex</var>&gt; ...&lt;/ProxyMatch&gt;</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">&lt;ProxyMatch&gt;</code> directive is
    identical to the <code class="directive"><a href="#proxy">&lt;Proxy&gt;</a></code> directive, except it matches URLs
    using regular expressions.</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="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
through</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards 10</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 and later</td></tr>
</table>
    <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
    maximum number of proxies through which a request may pass, if there's no
    <code>Max-Forwards</code> header supplied with the request. This is
    set to prevent infinite proxy loops, or a DoS attack.</p>

    <div class="example"><h3>Example</h3><p><code>
      ProxyMaxForwards 15
    </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="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<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 allows remote servers to be mapped into the space of
    the local server; the local server does not act as a proxy in the
    conventional sense, but appears to be a mirror of the remote
    server. <var>path</var> is the name of a local virtual path; <var>url</var>
    is a partial URL for the remote server and cannot include a query
    string.</p>

    <p>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/
    </code></p></div>

    <p>will cause a local request for
    <code>http://example.com/mirror/foo/bar</code> to be internally converted
    into a proxy request to <code>http://backend.example.com/bar</code>.</p>

    <p>The <code>!</code> directive is useful in situations where you don't want
    to reverse-proxy a subdirectory, <em>e.g.</em></p>

    <div class="example"><p><code>
      ProxyPass /mirror/foo/i !<br />
      ProxyPass /mirror/foo http://backend.example.com
    </code></p></div>

    <p>will proxy all requests to <code>/mirror/foo</code> to
    <code>backend.example.com</code> <em>except</em> requests made to
    <code>/mirror/foo/i</code>.</p>

    <div class="note"><h3>Note</h3>
      <p>Order is important. you need to put the exclusions <em>before</em> the
      general proxypass directive.</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>

    <div class="warning">The <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive should
    usually be set <strong>off</strong> when using
    <code class="directive">ProxyPass</code>.</div>

    <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://www.webthing.com/software/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/
    </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>

⌨️ 快捷键说明

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