3
我創建了新的環境「分段」。本地它的作品。我這樣運行:Nginx的Rails多級環境
RAILS_ENV=staging passenger start
在服務器上我使用Nginx +乘客。在我寫的虛擬主機設置中:
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;
}
但是app仍然在生產中運行。它加載生產數據庫,而不是登臺。重新加載Nginx並沒有幫助。哪裏不對?