0

我正在尝试在子域中创建一个新的 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 来检查我的应用程序?

请帮我解决这个问题。

4

0 回答 0