分类: LINUX
2011-05-25 11:22:37
为负载均衡组添加一个成员 | |
BalancerMember [balancerurl] url [key=value [key=value ...]] | |
directory | |
Extension | |
mod_proxy | |
BalancerMember is only available in Apache 2.2 and later. |
This directive adds a member to a load balancing group. It could be used
within a
The balancerurl is only needed when not in
--------------
Container for directives applied to proxied resources | |
server config, virtual host | |
Extension | |
mod_proxy |
Directives placed in
For example, the following will allow only hosts in yournetwork.example.com to access content via your proxy server:
Order Deny,Allow
Deny from all
Allow from yournetwork.example.com
The following example will process all files in the foo directory of example.com through the INCLUDES filter when they are sent through the proxy server:
SetOutputFilter INCLUDES
-------------------
Maps remote servers into the local server URL-space using regular expressions | |
ProxyPassMatch [regex] !|url [key=value [key=value ...]] | |
server config, virtual host, directory | |
Extension | |
mod_proxy | |
available in Apache 2.2.5 and later |
This directive is equivalent to , but makes use of regular expressions, instead of simple prefix matching. The supplied regular expression is matched against the url, and if it matches, the server will substitute any parenthesized matches into the given string and use it as a new url.
Suppose the local server has address then
ProxyPassMatch ^(/.*\.gif)$
will cause a local request for bar.gif to be internally converted into a proxy request to
The URL argument must be parsable as a URL before regexp substitutions (as well as after). This limits the matches you can use. For instance, if we had used
ProxyPassMatch ^(/.*\.gif)$
in our previous example, it would fail with a syntax error at server startup. This is a bug (PR 46665 in the ASF bugzilla), and the workaround is to reformulate the match:
ProxyPassMatch ^/(.*\.gif)$
The ! directive is useful in situations where you don't want to reverse-proxy a subdirectory.
When used inside a section, the first argument is omitted and the regexp is obtained from the .
If you require a more flexible reverse-proxy configuration, see the directive with the [P] flag.
------------------
Maps remote servers into the local server URL-space | |
ProxyPass [path] !|url [key=value key=value ...]] [nocanon] [interpolate] | |
server config, virtual host, directory | |
Extension | |
mod_proxy |
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. The local server is often called a reverse proxy or gateway. The path is the name of a local virtual path; url is a partial URL for the remote server and cannot include a query string.
Suppose the local server has address then
ProxyPass /mirror/foo/
will cause a local request for to be internally converted into a proxy request to bar.
-------------
Use incoming Host HTTP request header for proxy request | |
ProxyPreserveHost On|Off | |
ProxyPreserveHost Off | |
server config, virtual host | |
Extension | |
mod_proxy | |
Available in Apache 2.0.31 and later. |
When enabled, this option will pass the Host: line from the incoming request to the proxied host, instead of the hostname specified in the ProxyPass line.
This option should normally be turned Off. 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.