我在数字海洋上运行一个 Rails 应用程序。它工作完美。我想在同一个 VPS 上托管一个 Sinatra 应用程序。我已经设置了名称服务器和 DNS。
我opt/nginx/conf/nginx.conf
的是:
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /home/deploy/.rvm/gems/ruby-2.0.0-p0/gems/passenger-4.0.0.rc6;
passenger_ruby /home/deploy/.rvm/wrappers/ruby-2.0.0-p0/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name domain1.com;
charset utf-8;
root /home/deploy/apps/domain1/current/public;
passenger_enabled on;
rails_spawn_method smart;
rails_env production;
}
server {
listen 80;
server_name domain2.com www.domain2.com;
charset utf-8;
root /home/deploy/apps/domain2-path/public;
passenger_enabled on;
rails_spawn_method smart;
}
}
现在当我去 domain2.com 它加载 domain1.com 的应用程序,我做错了什么。
PS:Domain1.com 是 Rails 应用,Domain2.com 是 sinatra 应用。