NGINX - Two different rails apps under same domain

Posted by Murkin on Server Fault See other posts from Server Fault or by Murkin
Published on 2011-11-28T17:15:18Z Indexed on 2011/11/29 9:52 UTC
Read the original article Hit count: 182

I have two different Rails (passenger) apps that I wan to host on one server:

somehost.com/      <-- App #1
somehost.com/admin <--- App #2

Tried playing with the 'location' directive, but failed to have both operate.

Can someone suggest the correct approach ?

(I would prefer both to share same environment, only launch from different directories)

EDIT: Sample (desired) config

Trying to do something like:

server {
   listen 80;
   server_name myhost.com;
   rails_env production;
   passenger_enabled on;

  location / {
    root /opt/main_site/public/;
  }

  location /dev {
    root /opt/admin_site/public/;
  }
}

© Server Fault or respective owner

Related posts about nginx

Related posts about ruby-on-rails