2

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/;
  }
}
Boris
  • 123
  • 6

1 Answers1

2

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.

cjc
  • 24,916
  • 3
  • 51
  • 70