通过 Amazon Route53 访问给定主机的 DNS 时出错

Error while hitting DNS via Amazon Route53 to the given hosts

设置

R53--->ELB(Classic+SSL)--->Nginx(仅一例)

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

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

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

503 服务不可用:没有可用的服务器来处理此请求。

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

我的 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
        }
}

添加 server_name directive to nginx config. Also see How nginx processes a request.

Server names are defined using the server_name directive and determine which server block is used for a given request. See also “How nginx processes a request”. They may be defined using exact names, wildcard names, or regular expressions:

    server_name <Your Route53 Domain Name>;