【问题标题】:nginx would not react to wildcard subdomains (*.domain)nginx 不会对通配符子域 (*.domain) 做出反应
【发布时间】:2014-03-23 13:10:46
【问题描述】:

我在使用 nginx 通配符子域时遇到问题。

我从 godaddy 购买了一个域名。然后在 amazone 中创建主机区域,然后为 A(A-IPv4) 创建一个记录集 - 为 www.domain.com / domain.com

在 nginx.conf 中,我有非常基本的配置和 1 个如下所示的服务器文件:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;


    access_log   /var/log/nginx/domain.com.access.log;
    error_log    /var/log/nginx/domain.com.error.log;

    # i tried the following for server name: domain.com *.domain.com/*.domain.com/.domain.com
    server_name .domain.com;
    root /usr/share/nginx/html/test;
    index index.html;

}

当我访问 subdomain.domain.com 时,我得到 Firefox 在 subdomain.domain.com 上找不到服务器

查看访问日志文件没有任何记录,它完全是空的。

谢谢

【问题讨论】:

    标签: apache .htaccess nginx dns


    【解决方案1】:

    您还必须为子域添加 A 记录。在 Firefox 中访问网站之前,请尝试 ping - 您将查看是否可以解析域名。

    【讨论】:

    • 你的意思是为子域添加一条记录?
    • 我想我要在 amazone rout 53 中添加子域,而不是在 godaddy 中
    • 你在哪里添加 www.domain.com / domain.com ?
    • 我从 godaddy 购买了域名,然后在亚马逊我通过添加一个新的主机区域创建了名称服务器,并在其中向我的 ec2 实例的公共 IP 添加了一条记录。然后我将这 4 个 NS 添加到 godaddy DN manager
    猜你喜欢
    • 2022-01-25
    • 2016-04-30
    • 1970-01-01
    • 2012-08-09
    • 1970-01-01
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多