I’m trying to configure lighttpd to proxy traffic to one relative path to one proxy server, and traffic to another path to another proxy server.
For example:
http://mydomain.com/ proxies to 123.111.111.1
http://mydomain.com/apathname/ proxies to 123.111.111.2
I am flumoxed trying to figure out how to the the /apathname/ configured. This is a sample of what I have configured so far, which just directs all traffic to 123.111.111.1
$HTTP["host"] =~ "mydomain.com" {
proxy.balance = "fair"
proxy.server = (
"" =>
(
("host" => "123.111.111.1", "port" => "80" )
),
"apathname" =>
(
( "host" => "123.111.111.2", "port" => "80" )
)
)
}
My apologies if this question should be on another SO site. I’m primarily a coder, not a network guy, and I know I always get the best answers on SO itself, which is why I’m asking here.
You need to check the request URL from
$HTTP["url"]and set up multiple proxy rules, like this:In this example above:
/uploadwill be proxied to10.2.2.1:3000./submitwill be proxied to10.2.2.2:3000.