Answer the question
In order to leave comments, you need to log in
How to set up multiple Rails applications on one nginx?
Good day, I had a need to set up several Rails applications on one digitalocean droplet. Applications include API for mobile applications + admin panel, without domains, access from the world via "....ip/admin", "...ip/api/...." the applications themselves are in the same directory:
/home/user_name/apps/app_1
/home/user_name/apps/app_2
location /app-name_1/ {
passenger_enabled on;
rails_env development;
root /home/username/apps/app2_name/current/public;
}
location /app-name_2/ {
passenger_enabled on;
rails_env development;
root /home/username/apps/app2_name/current/public;
}
location ~ ^/(assets|images|fonts)/(.*)$ {
alias /home/user_name/apps/app_name/current/public/$1/$2;
gzip on;
expires max;
add_header Cache-Control public;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question