Rewrite URL before passing to proxy Lighttpd
- by futureelite7
Hi,
I'm trying to setup a reverse proxy in lighttpd, such that all requests (and only those requests) under /mobile/video is redirected to the / directory of a secondary web server. This is pretty easy in apache, but I can't for the life of me figure out how to do so in lighttpd.
$HTTP["url"] =~ "^/wsmobile/video/" {
url.rewrite-once = ( ".*" => "/test/" )
proxy.server = ( "" => ( ( "host" => "210.200.144.26", "port" => 9091 ) ) )
}
I've tried using the http["url"] directive, but lighttpd simply ignore those requests and continue to pass the full url to the secondary server, which of course chokes and throws 404s. However, if I do a global rewrite then everything gets forwarded to the secondary server, which is also not what I want.
How do I go about this task?