DeviceA充当反向代理,应该按如下方式转发请求:
192.168.1.10/DeviceB ==> 192.168.1.20/index.html
192.168.1.10/DeviceC ==> 192.168.1.30/index.html
两个索引文件都位于/ var/www下,并且是静态的"Hello world!" 页面.问题是我无法通过DeviceA访问这些文件,但如果我调用也在DeviceC上运行的测试服务(侦听端口12345),一切正常.
我错了说DeviceB上的Web服务器,如果端口80上有请求,DeviceC应该用index.html响应???
lighttpd.conf DeviceA @ 192.168.1.10 server.modules =("mod_proxy")
proxy.server = (
"/DeviceB" => ( "" => ( "host" => "192.168.1.20", "port" => 80 )),
"/DeviceC" => ( "" => ( "host" => "192.168.1.30", "port" => 80 )),
"/TestService" => ( "" => ( "host" => "192.168.1.30", "port" => 12345 ))
)
Run Code Online (Sandbox Code Playgroud)
lighttpd.conf DeviceB @ 192.168.1.20
server.document-root = "/var/www"
server.port = 80
index-file.names = ( "index.html" )
Run Code Online (Sandbox Code Playgroud)
lighttpd.conf DeviceC @ 192.168.1.30 …