Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two different Rails (passenger) apps that I wan to host on one server:      <-- App #1 <--- 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;
   rails_env production;
   passenger_enabled on;

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

  location /dev {
    root /opt/admin_site/public/;
share|improve this question
up vote 2 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

Your Answer


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.