Project

General

Profile

trac redirect (mod_proxy_core alternative)

Added by mathieumg over 13 years ago

I have setup a Trac installation (0.12.x) and I have a running lighttpd server as well as a tracd. I setup the following rule in lighttpd:

$HTTP["host"] == "xx.xx.xx.xx" {
$HTTP["url"] =~ "^trac" {
proxy.server = ("" => ("trac" => ("host" => "127.0.0.1", "port" => 8000)))
}
}

However, the problem with that is that it redirects requests from http://xx.xx.xx.xx/trac to the internal http://127.0.0.1:8000/trac whereas I want requests from http://xx.xx.xx.xx/trac + uri to be redirected to http://127.0.0.1:8000 + uri.

I found the exact example to do it with mod_proxy_core in http://redmine.lighttpd.net/wiki/1/Docs:ModProxyCore but it requires lighttpd 1.5+ and I'm running 1.4.x. I was wondering if there was another way to get to the same result in another way with lighttpd 1.4.x?

$HTTP["url"] =~ "^/trac/" {
proxy-core.backends = ( "127.0.0.1:8000" )
proxy-core.protocol = "fastcgi"
proxy-core.rewrite-request = (
"_pathinfo" => ( "^/trac(/.*)" => "$1" ),
"_scriptname" => ( "^(/trac/)" => "$1" )
)
}

Thank you very much

Running on Debian and lighttpd 1.4.19.