title: Multiple Ruby apps (Rails and Sinatra) deployed using Passenger for Nginx?
body: <p>I have two Ruby applications, one is under Rails and the another is under Sinatra.</p>
  
  <p>How can I deploy both these apps in Nginx and Passenger with one in the root ("localhost:3000") and the other in subroot ("localhost:3000/test")?</p>
  
  <p>The Rails application is running with this configuration. Everything seems to work OK:</p>
  
  <pre><code>server {
      listen       80;
      server_name  localhost;
  
      location / {
          root   /var/www/demo/public;
          passenger_enabled on;
          rails_env production;
      }
  
      location /test/ {
          root   /var/www/test/public;
          passenger_base_uri /test/;
          proxy_pass http://10.0.3.12:80/test/;
          passenger_enabled on;
      }
  </code></pre>
  
  <p>I am not able to access the second application.</p>
  
  <p>The server returns 404 for the second app and the first app is still running.</p>