【问题标题】:How to Alias a Page to a Sub-Domain如何将页面别名到子域
【发布时间】:2015-10-05 05:26:40
【问题描述】:

我在 LEMP 堆栈上运行 WordPress。

我有一个登陆页面:https://example.com/landing

我想把这个子域指向上面的页面:http://landing.example.com

我不想 301/302 将子域重定向到子目录。

我希望访问者认为他们仍在使用http://landing.example.com

This question 类似,但不能解决我的特定问题。

我需要知道如何用 nginx 重写请求并配置 DNS。

【问题讨论】:

    标签: wordpress nginx dns alias cname


    【解决方案1】:

    链接到以前的 post 讨论重写/重定向/虚拟主机。您想重写请求,然后将其置于同一服务器上或将其代理到不同的服务器。

    【讨论】:

      【解决方案2】:

      我找到了答案in this thread

      总结一下,需要用nginx代理请求:

          # abc.example.com
          server {
            listen 80;
            server_name .example.com;
            location / {
              proxy_pass http://127.0.0.1/abc$request_uri;
              proxy_set_header Host example.com;
            }
          }
      

      只需设置一条指向您服务器IP的A记录。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-01-12
        • 2017-12-26
        • 2021-08-08
        • 2016-04-20
        • 1970-01-01
        • 2016-09-03
        • 2015-07-07
        • 1970-01-01
        相关资源
        最近更新 更多