【问题标题】:How to connect domain to another subdomain?如何将域连接到另一个子域?
【发布时间】:2021-09-03 04:16:01
【问题描述】:

我有 apache 服务器。而且我有自己的域名:

  • domain.one
  • sub.domain.one

我还有另一个域名domain.two

我希望,当人们到达 domain.two 时,他们会看到来自 sub.domain.one 的内容

我需要找到解决方案,例如停车。 不允许 iframe 重定向。 当您打开 domain.two 时,它会打开 sub.domain.one

对于domain.two,我使用来自sub.domain.one 的IP 制作了A 记录。 但是当访问者打开domain.two 他看到domain.one - 但我需要sub.domain.one

我认为,在domain.one 的配置中,我需要进行一些更改,让服务器知道客户域的存在。

【问题讨论】:

    标签: apache configuration subdomain


    【解决方案1】:

    嗯,我用 nginx 代理管理它。

    这是一个方案:

    1. Domain.com - A-record 解析为您的 NGINX 代理服务器。
    2. Nginx 代理服务器对您的子域目标进行代理。

    Nginx 配置:

    server {
            server_name domain.com;
            location / {
                proxy_pass       http://sub.domain.com;
            }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-18
      相关资源
      最近更新 更多