ProxyPass 指令
说明
将一个远端服务器映射到本地服务器的URL空间中 |
语法
ProxyPass [path] !|url [key=value key=value ...]] |
作用域
server config, virtual host, directory |
状态
扩展(E) |
模块
mod_proxy |
该指令允许你将一个远端服务器映射到本地服务器的URL空间中,此时本地服务器并不充当代理角色,而是充当远程服务器的一个镜像。path是一个本地虚拟路径名,url是一个指向远程服务器的部分URL,并且不允许包含查询字符串。
当使用
ProxyPass 指令时,
ProxyRequests 指令通常应当被设为
off 。
假设本地服务器地址是:http://example.com/ ,那么,
ProxyPass /mirror/foo/ http://backend.example.com/
将会导致对http://example.com/mirror/foo/bar 的本地请求将会在内部转换为一个代理请求:http://backend.example.com/bar 。
“! “指令对于您不想对某个子目录进行反向代理时很有用。比如说:
ProxyPass /mirror/foo/i ! ProxyPass /mirror/foo http://backend.example.com
将会代理除/mirror/foo/i 之外的所有对backend.example.com 下/mirror/foo 的请求。
注意
顺序很重要,您需要把拒绝指令放置在普通ProxyPass 指令之前。
As of Apache 2.1, the ability to use pooled connections to a backend server is available. Using the key=value parameters it is possible to tune this connection pooling. The default for a Hard Maximum for the number of connections is the number of threads per process in the active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM it is controlled by the ThreadsPerChild .
Setting min will determine how many connections will always be open to the backend server. Upto the Soft Maximum or smax number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl . Apache will never create more than the Hard Maximum or max connections to the backend server.
ProxyPass /example http://backend.example.com smax=5 max=20 ttl=120 retry=300
Parameter Default Description
min |
0 |
Minumum number of connections that will always be open to the backend server. |
max |
1…n |
Hard Maximum number of connections that will be allowed to the backend server. The default for a Hard Maximum for the number of connections is the number of threads per process in the active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM it is controlled by the ThreadsPerChild . Apache will never create more than the Hard Maximum connections to the backend server. |
smax |
max |
Upto the Soft Maximum number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl . |
ttl |
– |
Time To Live for the inactive connections above the smax connections in seconds. Apache will close all connections that has not been used inside that time period. |
timeout |
Timeout |
Connection timeout in seconds. If not set the Apache will wait until the free connection is available. This directive is used for limiting the number of connections to the backend server together with max parameter. |
acquire |
-<
免责声明: 本文仅代表作者个人观点,与无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
推荐阅读
友情链接: Copyright © 2013-2023 页 当前在线:1015人 网站在1天2时7分17秒内访问总人数:289372人 当前 9.44% |
|