I'm trying to deploy a multisite Rails app with different views and public folders for each site. Let's say that we have www.foo.com and www.bar.com. Inside my RAILS_ROOT directory I have a [sites] directory with two folders inside [foo] and [bar] each folder consists of a [public] and [views] folder.
My nginx configuration has to be something like that:
server {
listen 80;
server_name www.foo.com;
root RAILS_ROOT/sites/bar/public;
passenger_enabled on;
rails_env development;
}
server {
listen 80;
server_name www.bar.com;
root RAILS_ROOT/sites/bar/public;
passenger_enabled on;
rails_env development;
}
My problem is that nginx can't actually find RAILS_ROOT as it expects a usual hierarchy for the public folder RAILS_ROOT/public. Any solution for this?