Chinaunix首页 | 论坛 | 博客
  • 博客访问: 201684
  • 博文数量: 42
  • 博客积分: 2216
  • 博客等级: 大尉
  • 技术积分: 440
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-11 19:38
文章分类

全部博文(42)

文章存档

2013年(1)

2011年(9)

2010年(23)

2009年(9)

我的朋友

分类: LINUX

2011-05-25 11:22:37

httpd.conf 重要的配置是流量转发,负载均衡的功能
相关配置参数说明如下,内容来自于,更详细配置信息见该网页。
---------------
为负载均衡组添加一个成员
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 container directive, and can take any of the key value pairs available to directives.

The balancerurl is only needed when not in container directive. It corresponds to the url of a balancer defined in directive.

--------------

Container for directives applied to proxied resources
...
server config, virtual host
Extension
mod_proxy

Directives placed in sections apply only to matching proxied content. Shell-style wildcards are allowed.

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

Note

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.

The directive should usually be set off when using ProxyPass.

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.


阅读(1478) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~