Proxy.server and url.rewrite-once


#1

i have a very simple lighttpd config that just forwards with mod_proxy
some requests to different hosts lixe this:

server.modules = ( “mod_proxy”, “mod_rewrite” )

server.port = 80
server.pid-file = “/var/run/lighttpd.pid”
server.errorlog = “/var/log/lighttpd-err.log”
server.document-root = “/var/www/htdocs/”

$HTTP[“url”] =~ “^/simons_app” {
url.rewrite-once = ( “” => “” ) # <= WHAT SHOULD I WRITE HERE?
proxy.server = ( “” => ( ( “host” => “10.0.0.12”,
“port” => 3000 )
)
)
}

$HTTP[“url”] =~ “^/marks_app” {
url.rewrite-once = ( “” => “” ) # <= WHAT SHOULD I WRITE HERE?
proxy.server = ( “” => ( ( “host” => “10.0.0.15”,
“port” => 3000 )
)
)
}

so when a request comes in with an url like
http://www.example.com/marks_app/people
it is forwarded to 10.0.0.15:3000/marks_app/people
this does not work because i get a routing error from the rails app (the
“marks_app” controller does not exist), therefore i’d like to get rid of
the “marks_app” part in the url before routing the request to the
correct server. can i do this with url.rewrite-once? how?


#2

On Nov 30, 2005, at 1:41 AM, Simon S. wrote:

i have a very simple lighttpd config that just forwards with mod_proxy
some requests to different hosts lixe this:

Simon-

You need to make sure you are running the latest lighttpd 1.4.8 and

then follow these instructions. This feature was just added to lighty
and it does exactly what you are looking for:

http://blog.lighttpd.net/articles/2005/11/23/lighttpd-1-4-8-and-
multiple-rails-apps

Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid