$HTTP["url"] =~ "^/base_url_to_app1/" {
server.document-root = "/path/to/app1/public/"
alias.url = ( "/base_url_to_app1/" => "/path/to/app1/public/" )
server.error-handler-404 = "/base_url_to_app1/dispatch.fcgi"
fastcgi.server = (
".fcgi" => ( (
"socket" => "/tmp/app1.socket",
"bin-path" => "/path/to/app1/public/dispatch.fcgi",
) )
)
}
$HTTP["url"] =~ "^/base_url_to_app2/" {
}
module ActionController
class AbstractRequest
alias_method :orig_rel_url_root, :relative_url_root
def relative_url_root
if (@env['SCRIPT_NAME'] && /\/dispatch\.(fcgi|rb|cgi)$/ =~ @env['SCRIPT_NAME'])
@env["SCRIPT_NAME"].to_s.sub(/\/dispatch\.(fcgi|rb|cgi)$/, '')
else
orig_rel_url_root
end
end
end
end