潜龙勿用,见龙在田
全部博文(540)
分类: 系统运维
2009-06-05 17:35:25
该模块主要是用来连接lighttpd和动态服务器的,如tomcat,在配置文件中输入如下:
$HTTP["url"] =~ ".jsp|.go|.do|action" {
proxy.balance = "fair"
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8080 ),("host" => "127.0.0.1", "port" => 18080) ))
}
其中host字段表示代理服务器的配置(ip和端口),如果有多个则可以配置负载服务器,这里配置的是两个。proxy.blance用来做负载均衡,具体的没有研究过,大家可以参看官方文档详细了解下。
$HTTP["host"] == "" { proxy.balance = "hash" proxy.server = ( "" => ( ( "host" => "10.0.0.10" ), ( "host" => "10.0.0.11" ), ( "host" => "10.0.0.12" ), ( "host" => "10.0.0.13" ), ( "host" => "10.0.0.14" ), ( "host" => "10.0.0.15" ), ( "host" => "10.0.0.16" ), ( "host" => "10.0.0.17" ) ) ) }