Lighttpd gotchas
[ Posted by Urban Hafner ]
I just tried to setup lighttpd (1.4.13) to run several sites side by side and run one of them on a different port. The following things should be noted:
server.prot
You can’t just set server.port. It’s a global variable a overwrites the previous ones.
$SERVER[“socket”] and $HTTP[“host”]
Using $SERVER["socket"] and $HTTP["host"] together doesn’t work. I tried to do the following:
$SERVER["socket"] == "0.0.0.0:5005" {
$HTTP["host"] == "example.com" {
server.errorlog = "/error.log"
accesslog.filename = "/access.log"
proxy.balance = "fair"
proxy.server = ( "/" =>
(("host" => "127.0.0.1", "port" => 5001))
)
}
}
But that doesn’t work! I ended up removing the $HTTP["host"] part. Which is not that nice as you can now access the site on port 5005 using all the other URLs defined in the config file!
Are there any solutions to this problem?

