Hello There, Today I am going to tell you how you can run multiple rails applications on a single server with different sub urls. I am using ````nginx +
passenger``` to run applications.
Here is an implementation how can we run multiple rails applications over a single machine:
Deploy both applications on server:
First step to deploy both application on single server.
Edit nginx configs
run command sudo nano /etc/nginx/site-enabled/APPLICATION_CONFIG
and change root and base uri as like following lines of code in the file:
Restart nginx service:
sudo service nginx restart
Create a symlink for second application
ln -s PATH_OF_SECOND_APP/public PATH_OF_FIRST_APP/public/APP2
Restart passenger:
touch tmp/restart.txt
Now you can visit your ip/domain, as you can see:
www.example.com
will be serving the first application.www.example.com/APP2
will be service the second application.