【问题标题】:How to set up a subdomain, should I set something for my DNS host server?如何设置子域,我应该为我的 DNS 主机服务器设置一些东西吗?
【发布时间】:2014-10-28 18:58:17
【问题描述】:

例如,如果我的服务器上已经有一个域 test.com 指向 /www/test

当用户链接到anthoer.test.com时,如何重定向到/home/another文件夹

我在 site-avaliable 下添加了test 配置文件并启用它,但它不起作用。

我通过wget访问,然后得到failed: nodename nor servname provided, or not known.

    server {
        listen       80;
        server_name  another.test.com;
        root /home/another;

        location / {
            root /home/another;
            if (-f $request_filename) {
                rewrite ^/(.*)$  /$1 break;
            }
        }
    }

【问题讨论】:

    标签: nginx dns subdomain virtualhost


    【解决方案1】:

    是的,您可以在 DNS 提供商上添加 A 记录:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-04
      • 2020-05-22
      • 2013-07-22
      • 2017-06-26
      • 2011-04-14
      • 2020-04-18
      • 2018-07-08
      相关资源
      最近更新 更多