0

I have a http server running on localhost:50001 and a ssl enabled server on localhost:50002, my root domain is say example.com lighttpd serves a directory when example.com is requested. I need to forward example.com:50001 and example.com:50002 to localhost:50001 and localhost:50002.

I am not able to achieve this, I tried config below

&HTTP["host"] == "example.com:50001" {
        proxy-core.backends = ("localhost:50001")
        }


$HTTP["host"] == "example.com" {
        server.document-root = "/var/www/servers/example.com"
        }

But that causes an error. I haven't tried configuring for ssl server.

1

1 Answer 1

0

you should separate listener for localhost and external 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"
    }

I think you are producing a loop with your config.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .