我创建了新的环境“ staging”.在本地有效.我这样运行:
RAILS_ENV=staging passenger start
在服务器上,我使用Nginx passenger.在虚拟主机设置中,我写了:
server {
listen 443;
server_name test.myapp.com;
rails_env staging;
root /home/admin/myapp/current/public; # <-- be sure to point to 'public'
passenger_enabled on;
ssl on;
ssl_certificate /home/admin/ssl/server.crt;
ssl_certificate_key /home/admin/ssl/server.key;
}
server {
listen 80;
server_name test.myapp.com;
root /home/admin/myapp/current/public;
rewrite ^ https://$server_name$request_uri? permanent;
}
最佳答案
我认为您缺少rails_env设置.
原文链接:/nginx/532393.htmlserver {
...
rails_env staging;
}