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/;
  }
}
link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

What did you actually try to do with the location directives? Can you post that?

Something like:

  location /admin {
    proxy_pass http://app2;
  }

  location / {
    proxy_pass http://app1;
  }

should work.

link|improve this answer
I added a sample config – Boris Nov 29 '11 at 9:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.