将50001,50002上的http和ssl请求redirect到localhost端口lighttpd

我有一个在localhost:50001上运行的http服务器和在localhost:50002上启用ssl的服务器,我的根域是example.com lighttpd在请求example.com时提供服务。 我需要将example.com:50001example.com:50002转发到localhost:50001localhost:50002

我无法实现这一点,我尝试下面的configuration

 &HTTP["host"] == "example.com:50001" { proxy-core.backends = ("localhost:50001") } $HTTP["host"] == "example.com" { server.document-root = "/var/www/servers/example.com" } 

但是这会导致错误。 我还没有尝试configurationssl服务器。

你应该单独监听本地主机和外部IP。

 # in this config are only relevant parts listed server.port = 50001 server.bind = "192.168.0.1" $HTTP["host"] == "example.com:50001" { proxy-core.backends = ("localhost:50001") } $SERVER["socket"] == "localhost:50001" { $HTTP["host"] == "example.com" { server.document-root = "/var/www/servers/example.com" } 

我想你正在用你的configuration生成一个循环。