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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.