【问题标题】:Error while hitting DNS via Amazon Route53 to the given hosts通过 Amazon Route53 访问给定主机的 DNS 时出错
【发布时间】:2018-10-17 19:32:14
【问题描述】:

设置

R53--->ELB(Classic+SSL)--->Nginx(只有一个实例)

我的 Nginx 服务器上正在运行一个应用程序,它正在侦听端口 80。Nginx 实例工作正常,我可以通过其公共 IP 访问它。

我现在在我的 Nginx 前面放置了一个 ELB,ELB 将我的实例注册为健康的,我可以点击 ELB(经典)公共 URL 来访问我的网站。我正在终止 ELB 本身的 SSL

现在,当我在 Route53 上放置一个 CNAME 条目并将其指向我的 ELB 时,我到达了

503 Service Unavailable : 没有服务器可以处理这个请求。

我尝试了很多方法,但不知道为什么会这样。

我的 Nginx 文件看起来像:

server {
        listen 80 ;
        listen [::]:80;

        root /home/ubuntu/partner/public;
        index index.html index.htm index.nginx-debian.html;

        # Make site accessible from http://asw.xyz.community/

        #server_name drone.xyz.community;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log debug;

        #return 301 $schema://www.drone.xyz.community$request_uri;



        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
}

【问题讨论】:

    标签: amazon-web-services nginx amazon-elb amazon-route53


    【解决方案1】:

    server_name 指令添加到 nginx 配置中。另见How nginx processes a request

    服务器名称使用 server_name 指令定义并确定 哪个服务器块用于给定请求。另请参阅“如何使用 nginx 处理请求”。它们可以使用确切的名称、通配符来定义 名称或正则表达式:

        server_name <Your Route53 Domain Name>;
    

    【讨论】:

    • aws elb describe-instance-health --load-balancer-name &lt;elb-name&gt; 你在描述中看到了什么?你能发布这个输出吗?
    • 不知何故它给了我调用 DescribeInstanceHealth 操作时发生错误(ValidationError):LoadBalancer 名称不能超过 32 个字符,尽管我看到 ELB 后面的健康实例
    • 只提及名称,而不是完整的 DNS
    • 调用DescribeInstanceHealth操作时出错(LoadBalancerNotFound):没有ACTIVE负载均衡器命名
    • 等等,我看到 10.0.1.54 - - [21/Mar/2018:07:18:24 +0000] "GET / HTTP/1.1" 200 1104 "-" "ELB-HealthChecker/1.0 " 10.0.1.68 - - [21/Mar/2018:07:18:24 +0000] "GET / HTTP/1.1" 200 1104 "-" "ELB-HealthChecker/1.0"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-05
    • 1970-01-01
    • 2016-01-20
    • 2016-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多