Forum: Ruby on Rails proxy.server and url.rewrite-once

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
simon.santoro (Guest)
on 2005-11-30 11:45
(Received via mailing list)
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?
ezra (Guest)
on 2005-11-30 20:49
(Received via mailing list)
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/light...
multiple-rails-apps


Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid
This topic is locked and can not be replied to.