简体   繁体   English

为什么我的非 www https url 不工作?

[英]why are my non www https url not working?

I created a static s3 bucket site that works.我创建了一个有效的 static s3 存储桶站点。 I created a certificate for:我创建了一个证书:

with additional names:附加名称:

  • *.example.com *.example.com
  • example.com例子.com

In my DNS I successfully attached all 2 certificates.在我的 DNS 中,我成功附加了所有 2 个证书。 Yes, all 2 because the wildcard and the blank subdomain were the same CNAME values.是的,都是 2,因为通配符和空白子域是相同的 CNAME 值。

In the DNS I have www.example.com CNAME going to the cloudfront url.在 DNS 我有www.example.com CNAME 去云端 url。

I figured maybe this was the issue and I should use no www and also try a wildcard, but both simply didn't work and nothing loaded.我想也许这就是问题所在,我应该不使用 www 并尝试使用通配符,但两者都不起作用,也没有加载任何内容。

I then created a CloudFront and attached the certificate to it with Alternate Domain Names (CNAMEs)然后,我创建了一个 CloudFront 并使用备用域名 (CNAME) 将证书附加到它

In CloudFront my Viewer Protocol Policy is REDIRECT TO HTTPS在 CloudFront 中,我的查看器协议策略重定向到 HTTPS

The behavior:行为:

One other thing is, I do have a separate certificate for a separate website on a subdomain sub.example.com.另一件事是,我确实有一个单独的证书,用于子域 sub.example.com 上的单独网站。 Would this possibly affect it?这可能会影响它吗?

Is there anything that stands out that would be doing this?有什么突出的东西可以做到这一点吗?

Based on the comments.根据评论。

Resolution of example.com did not work because the DNS host (name.com) was set to resolve only www.example.com into CloudFront distro url. Resolution of example.com did not work because the DNS host (name.com) was set to resolve only www.example.com into CloudFront distro url.

The solution was to add ANAME record to point example.com into CloudFront distro url.解决方案是将ANAME记录添加到点example.com到 CloudFront 发行版 url 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM