Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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/;
  }
}
share|improve this question
add comment

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.

share|improve this answer
    
I added a sample config –  Boris Nov 29 '11 at 9:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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