[4NEWBIE] Proxying [TIP]

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:

ProxyPass /rails/ http://yoda.local:3000/rails/ ProxyRequests Off

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 |

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:

ProxyPass /rails/ http://yoda.local:3000/rails/
 ProxyPassReverse  /rails/ http://yoda.local:3000/rails/

ProxyRequests Off

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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
[email protected]
509-577-7732