两种方法,可以根据自己情况来使用,但是根据网友所说,lighttpd的反代作用并不比nginx强。
在 /etc/lighttpd/vhosts (直接在lighttpd伪静态规则里添加)里加入
$HTTP["host"] =~ "(^sample.com)$" {
proxy.server = (
"/sr/" => ( (
"host" => "x.x.x.x",
"port" => 80
) )
)
}
$HTTP["url"] =~ "^/webmail" {
# add host header
setenv.add-request-header ( "Host" => "example2.org" )
proxy.server = ("/webmail/" => (
# this entry should link to example2.org
("host" => "1.2.3.4", "port" => 80)
))
}
lighttpd开启多端口访问的方法
$SERVER["socket"] == "ip:port" {
}
有几个端口加几个

0 条评论
您的邮箱地址和手机号码不会被公开。 必填项已用 * 标注