I am trying to configure Lighttpd as a reverse proxy. I want to have several URLs that are proxied on different servers on different ports, either on the same computer or on the local network.
For instance:
// static / connector / ajax
Lighttpd will proxy all connections except those specified in /static. I want to serve all requests /staticdirectly from this lighttpd instance.
Here is the configuration file for mod_proxy:
$HTTP["url"] =~ "^/static/" {
server.document-root = "/path/to/my/static/files"
accesslog.filename = rootdir + "/var/log/static.log"
server.errorlog = rootdir + "/var/log/static.error.log"
}
else $HTTP["url"] =~ "^/socket/" {
accesslog.filename = rootdir + "/var/log/socket.log"
server.errorlog = rootdir + "/var/log/socket.error.log"
proxy.server = (
"" => ( (
"host" => "127.0.0.1",
"port" => 3000
) )
)
}
else $HTTP["url"] =~ "^/ajax/" {
accesslog.filename = rootdir + "/var/log/ajax.log"
server.errorlog = rootdir + "/var/log/ajax.error.log"
proxy.server = (
"" => ( (
"host" => "127.0.0.1",
"port" => 4000
) )
)
}
else $HTTP["url"] =~ "^/" {
accesslog.filename = rootdir + "/var/log/root.log"
server.errorlog = rootdir + "/var/log/root.error.log"
proxy.server = (
"" => ( (
"host" => "127.0.0.1",
"port" => 5000
) )
)
}
I am sure my regular expressions are wrong. I also think the line elseis incorrect. I just don't know how to do this. I am new to this area, so I would appreciate some pushing in the right direction.
Thank,