我真的刚刚开始与lighttpd,我不知道如何正确configuration。
我想要采取stream量和redirect到另一台服务器说:“ http:// localhost / url_a / ”,并redirect请求和响应到“ http:// other_server:8080 / ”
另一个例子是“ http:// localhost / url_b / ”去“ http:// other_server:8081 / url_b / ”
为了完成这个,我究竟应该考虑什么?
谢谢。
在Lighttpd 1.4中,您需要使用mod_proxy将请求转发到其他服务器。
proxy.server = ("/url_a" => (( "host" => "1.2.3.4", "port" => 8080, )))
1.4中更改URLpath或虚拟主机名有点棘手。 如果你使用的是1.5,你可以使用mod_proxy_core来代替,这是更可configuration的:
$HTTP["url"] =~ "^/url_a" { proxy-core.protocol = "http" proxy-core.backends = ("other_server:8080") proxy-core.rewrite-request = ( "_uri" => ( "^/url_a/?(.*)" => "/$1" ), "Host" => ( ".*" => "other_server" ), ) }