使用Passenger和Nginx将Rails应用程序部署到子URI? [英] Deploying a Rails app to a sub-URI with Passenger and Nginx?
本文介绍了使用Passenger和Nginx将Rails应用程序部署到子URI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我的服务器配置:
server {
listen 80;
server_name localhost;
location / {
root / var / www / demo / public;
passenger_enabled on;
rails_env生产;
}
现在我要将第二个应用程序部署到子URI。这里文档有点不清楚。
有人可以建议我下一个配置是什么?
下面是我用于我的第二个配置(Sinatra)应用程序:
location / log {
root / var / www / logger / public;
passenger_base_uri / log;
passenger_enabled on;
}
我收到404未找到。请建议我在这里缺少什么。
解决方案
最后它正在工作!
nginx.conf:
server {
listen 80;
server_name localhost;
location / {
root / var / www / demo / public;
passenger_enabled on;
rails_env生产;
}
location / test {
root / var / www / demo;
passenger_base_uri / test;
passenger_enabled on;
}
然后:
ln -s / var / www / logger / public / var / www / demo / test
感谢您的帮助。
I am already deployed my Rails app with Passenger and Nginx and it's working fine. Below is my servier configuration:
server {
listen 80;
server_name localhost;
location / {
root /var/www/demo/public;
passenger_enabled on;
rails_env production;
}
Now I want to deploy a second app to a sub URI. Here the documentation is a little unclear.
Could anyone please suggest me what will be the next configuration?
Below is the configuration I am using for my second (Sinatra) application:
location /log {
root /var/www/logger/public;
passenger_base_uri /log;
passenger_enabled on;
}
I am getting "404 Not Found". Please suggest what I am missing here.
解决方案
Finally it's working!
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;
}
Then:
ln -s /var/www/logger/public /var/www/demo/test
Thanks for all your help.
这篇关于使用Passenger和Nginx将Rails应用程序部署到子URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文