niikawa@niikawa1:~$ curl -vv https://xyzxyzxyzxyzx.cloudfront.net
* Rebuilt URL to: https://xyzxyzxyzxyzx.cloudfront.net/
* Trying xxx.xxx.xxx.xxx...
* TCP_NODELAY set
* Connected to xyzxyzxyzxyzx.cloudfront.net (xxx.xxx.xxx.xxx) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=Washington; L=Seattle; O=Amazon.com, Inc.; CN=*.cloudfront.net
* start date: Jul 17 00:00:00 2019 GMT
* expire date: Jul 5 12:00:00 2020 GMT
* subjectAltName: host "xyzxyzxyzxyzx.cloudfront.net" matched cert's "*.cloudfront.net"
* issuer: C=US; O=DigiCert Inc; CN=DigiCert Global CA G2
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fffc6f00580)
> GET / HTTP/2
> Host: xyzxyzxyzxyzx.cloudfront.net
> User-Agent: curl/7.58.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 504
< content-type: text/html
< content-length: 1033
< server: CloudFront
< date: Thu, 09 Apr 2020 00:35:34 GMT
< x-cache: Error from cloudfront
< via: 1.1 3230a3d42078a094780d1894002fcfd5.cloudfront.net (CloudFront)
< x-amz-cf-pop: NRT12-C2
< x-amz-cf-id: bG4vtNFlQtECuxXDcUtZRGleu1OVZQO5NH0Ot5Qy7q2sQjzRgCA1MQ==
< age: 150
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>504 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: QsreLiLT9THqTGxKduq8Yro-6iddWuspLwPtrwHxHiFa4CUseAxWFA==
</PRE>
<ADDRESS>
</ADDRESS>
* Connection #0 to host xyzxyzxyzxyzx.cloudfront.net left intact
</BODY></HTML>
CloudFront代替ドメイン名の疎通確認がOKに
前述の通りセキュリティグループを見直し、エラーを対処しました。改めてCloudFront のデフォルトのDNS名および代替ドメイン名に対して疎通確認を行い、200 OK が返ることを確認します。下記結果より、curl コマンドでレスポンスが返りました。(curl の-vv オプションの結果は省略)