Forum: Ruby on Rails [4NEWBIE] Proxying [TIP]

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.
giovanni.giorgi (Guest)
on 2005-12-03 15:17
(Received via mailing list)
Hi,
  I'd like to spread to other rubyOnRails developers this simple
configuration I found userful for setting up ruby.

A easy way to set up ruby is to proxying the request versus WEBrick.
This is not the preferred way for a true production site but it works
fine.


To to so, I have changed the "config/routes.rb" to prepend the /
rails/ path to every url:
   #[GG] Changed to support  proxing
   map.connect 'rails/:controller/:action/:id'

Then I set up on apache a proxy rule like this:

<IfModule mod_proxy.c>
  ProxyPass /rails/ http://yoda.local:3000/rails/
  ProxyRequests Off
</IfModule>

It works fine and result also in a centralized way of distributing
the load.
For instance, I have to machine on my site:

+ a true old web server (very slow, it can serve only static pages
and so on)
+ a brand new mac mini, powered by ruby on rails

So the slow machine forward the request to the mac mini, and I get a
very FAST way of setting up a development
env. on the internet!

For more magic tips see
http://manuals.rubyonrails.com/read/chapter/65

--
    [   [  [ JJ ]  ]   ]  | Temi cio' che conosci, non
                          | cio' che non conosci
http://www.siforge.org   |
ezra (Guest)
on 2005-12-03 15:17
(Received via mailing list)
On Nov 20, 2005, at 6:28 AM, Giovanni Giorgi wrote:

> rails/ path to every url:
>   #[GG] Changed to support  proxing
>   map.connect 'rails/:controller/:action/:id'
>
> Then I set up on apache a proxy rule like this:
>
> <IfModule mod_proxy.c>
>  ProxyPass /rails/ http://yoda.local:3000/rails/
     ProxyPassReverse  /rails/ http://yoda.local:3000/rails/
>  ProxyRequests Off
> </IfModule>

If you add the above rails will never interject the port number onto
the url.
> a very FAST way of setting up a development
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
This topic is locked and can not be replied to.