After a half day''s work I''ve created a Merb app to handle file uploads for a Rails app. In my dev environment, I changed the views in the Rails app to point to Merb on port 4000. But now I''m stuck trying to figure out how to deploy my new Merb app on a production server. Looks like originally this was handled with a rewrite rule <http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/7a6de82eddf71d15/> More recently, the slides here mention a Merb Mongrel handler <http://brainspl.at/articles/2007/04/23/slides-from-my-mongrel-merb-talk> What''s the current best practice for Merb running alongside Rails? Cheers, -pete
I ended up using an apache rewrite rule to redirect file uploads to merb. It took me enough time to get this working, that I''m sharing it in case others find it useful: RewriteEngine On RewriteCond %{HTTP:Content-Type} multipart/form-data #RewriteCond %{REQUEST_URI} your-regex RewriteCond %{REQUEST_METHOD} POST RewriteRule ^/(.*) http://127.0.0.1:4000/$1 [P] With the commented out line, this will let merb handle all multipart post requests. You can un-comment the 3rd line and add your own expression to further limit what is handed to Merb. Cheers, -pete
Thanks, Did anyone tried to do something like that with nginx ? -Matt On 8/1/07, Cocoa Guy <cocoa.guy at gmail.com> wrote:> > I ended up using an apache rewrite rule to redirect file uploads to > merb. It took me enough time to get this working, that I''m sharing it > in case others find it useful: > > RewriteEngine On > RewriteCond %{HTTP:Content-Type} multipart/form-data > #RewriteCond %{REQUEST_URI} your-regex > RewriteCond %{REQUEST_METHOD} POST > RewriteRule ^/(.*) http://127.0.0.1:4000/$1 [P] > > With the commented out line, this will let merb handle all multipart > post requests. You can un-comment the 3rd line and add your own > expression to further limit what is handed to Merb. > > Cheers, > -pete > _______________________________________________ > Merb-devel mailing list > Merb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/merb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070802/4b1f6cd0/attachment.html