Ruby Hyderabad Message Board › Multiple Ruby apps(rails and sinatra) deployed on passenger for nginx

Multiple Ruby apps(rails and sinatra) deployed on passenger for nginx

Pravin M.
pravinmishra88
Gurgaon, IN
Post #: 12


I have two ruby apps(once rails and another is sinatra), How can I deploy these both app in nginx + passenger with one in the root(localhost:3000)? and another on subroot(localhost:3000/test).

Rails app running with this configuration everything seems to work ok.

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/t...­
passenger_enabled on;
}

I am not able to access the second app.

The server returns 404 for the second app and the first app is still running.
shyam mohan k.
user 12771449
Hyderabad, IN
Post #: 17
Try thses resources
http://railscasts.com...­
http://blog.tty.nl/20...­

mounting sinatra app in to rails will be good idea ,
so that no need to start setrver in two places. you can get idea from here how to mount here
http://railscasts.com...­
http://inductor.induk...­

Pravin M.
pravinmishra88
Gurgaon, IN
Post #: 13
Finally it's working....!!!

1. nginx.conf

server {
listen 80;
server_name localhost;
location / {
root /var/www/demo/public;
passenger_enabled on;
rails_env production;
}

location /test {
root /var/www/demo;
passenger_base_uri /test;
passenger_enabled on;
}

2. ln -s /var/www/logger/public /var/wwww/demo/test
Thanks for all help.
Powered by mvnForum

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy