lighttpd 1.4.8 supports multiple rails aps via ‘strip-request-uri’. Lighty guys wrote about it here.
‘strip-request-uri’ strips URI’s from returning html, which is great if you’re proxying your application through another server. In my case I run apache as a primary server. All my Ruby on rails applications are on lighttpd running on the same server, but higher port, 8888.
One of the domains on the primary server, metak.com, runs my ajaxed dictionary application. For usability purposes I want this domain to operate in “/”, but my true location on lighty server is “/lat/recnik/”. ‘strip-request-uri’ does exactly what’s needed to fix this. Not just that it allows you to have multiple apps, but it gets rid of this “/lat/recnik/” path from resulting html.
Another way of getting multiple apps to work was brought up in the comments of lighty’s post. It works by adding code in rails environment.rb file:
ActionController::AbstractRequest.relative_url_root = “/lat/recnik”
This sure works, but the resulting html includes absolute uri’s “/lat/recnik/….”, so when you access it through the proxy it points to “/lat/recnik” directory which doesn’t exist on the primary server.
This method sure works better if you’re running lighty as a primary server 
Finally, here’s my config file:
# lighttpd configuration file
#
# use a it as base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
############ Options you really have to take care of ####################
## modules to load
server.modules = ("mod_rewrite", "mod_alias", "mod_access", "mod_status", "mod_fastcgi", "mod_accesslog" )
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/www/site/"
## where to send error-messages to
server.errorlog = "/www/log/error.log"
# files to check for if .../ is requested
index-file.names = ( "index.html", "index.htm", "default.htm" )
# mimetype mapping
mimetype.assign = (
".pdf" => "application/pdf",
[.... lots of boring lines here. Copy them from your original config file! ]
".tar.bz2" => "application/x-bzip-compressed-tar"
)
## be nice and keep it at lighttpd
server.tag = "lighttpd | SerbianCafe"
#### accesslog module
accesslog.filename = "/www/log/access.log"
## deny access the file-extensions
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ ".pdf$" {
server.range-requests = "disable"
}
# which extensions should not be handle via static-file transfer
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
######### Options that are good to be but not neccesary to be changed #######
## bind to port (default: 80)
# Use high ports unless you want to run the web server as root
server.port = 8888
## bind to localhost (default: all interfaces)
#server.bind = "serbiancafe.com"
## to help the rc.scripts
server.pid-file = "/www/run/lighttpd.pid"
#### status module
status.status-url = "/server-status"
$HTTP["url"] =~ "^/lat/recnik/" {
server.document-root = "/www/site/lat/recnik/public/"
alias.url = ( "/lat/recnik/" => "/www/site/lat/recnik/public/" )
server.error-handler-404 = "/lat/recnik/dispatch.fcgi"
fastcgi.server = ( "/lat/recnik/dispatch.fcgi" =>
(( "socket" => "/www/tmp/recnik.socket" ,
"bin-path" => "/www/site/lat/recnik/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" ),
"strip-request-uri" => "/lat/recnik"
)))
}
$HTTP["url"] =~ "^/typo/" {
server.document-root = "/www/railsapps/typo/public/"
alias.url = ( "/typo/" => "/www/railsapps/typo/public/" )
server.error-handler-404 = "/typo/dispatch.fcgi"
fastcgi.server = ( "/typo/dispatch.fcgi" =>
(( "socket" => "/www/tmp/typo.socket" ,
"bin-path" => "/www/railsapps/typo/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" ),
"strip-request-uri" => "/typo"
)))
}
### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"
## change uid to (default: don't care)
server.username = "wwwrun"
## change uid to (default: don't care)
server.groupname = "wwwrun"
#### compress module
#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
#compress.filetype = ("text/plain", "text/html")