HOME

lighttpd 配置负载均衡

我的lighttpd的版本为 1.4.35

首先在/etc/lighttpd/modules.conf 中配置mod_proxy

server.modules = ( 
  ......
  "mod_proxy",
  ......
)

然后修改/etc/lighttpd/lighttpd.conf 1

$HTTP["host"] == "houye.xyz" {
    proxy.balance = "hash" 
    proxy.server  = ( "" => ( ( "host" => "10.0.0.10","port"=>8080),
                              ( "host" => "10.0.0.11" )))
   
  }

Footnotes:

1

https://redmine.lighttpd.net/projects/1/wiki/Docs_ModProxy