Ruby on rails 子域rails nginx unicorn如何实现?

Ruby on rails 子域rails nginx unicorn如何实现?,ruby-on-rails,nginx,capistrano,unicorn,Ruby On Rails,Nginx,Capistrano,Unicorn,我正在尝试在子域中使用一个新的rails应用程序,我尝试了几个,但我无法解决它 我有子域名xxx.domain.com 我正在尝试创建新的子域名yyy.domain.com 这是我的nginx配置文件 upstream unicorn1 { server unix:/tmp/unicorn.xxx.sock fail_timeout=0; } upstream unicorn2 { server unix:/tmp/unicorn.yyy.sock fail_timeout=0; } ser

我正在尝试在子域中使用一个新的rails应用程序,我尝试了几个,但我无法解决它

我有子域名xxx.domain.com 我正在尝试创建新的子域名yyy.domain.com

这是我的nginx配置文件

upstream unicorn1 {
server unix:/tmp/unicorn.xxx.sock fail_timeout=0;
}
upstream unicorn2 {
  server unix:/tmp/unicorn.yyy.sock fail_timeout=0;
}
server {
  listen 80;
  server_name xxx.domain.com;
  root /home/ubuntu/apps/xxx/current/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn1;
  location @unicorn1 {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn1;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;

}
server {
  listen 80;
  server_name yyy.domain.com;
  root /home/ubuntu/apps/yyy/current/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn2;
  location @unicorn2 {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn2;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;

}
另一个子域即yyy.domain.com始终显示站点xxx.domain.com

如何指向yyy.domain.com检查我的应用程序


请帮我解决这个问题。

你能显示你的unicorn配置文件吗?(特别是:他们的
#listen
指令)另外,你在标签中提到了它是关于capistrano的。显示重启应用程序的capistrano任务可能会有所帮助。