如何将我的域与我的 AWS Lightsail 容器服务一起使用?

时间:2021-02-23 11:44:32

标签: amazon-web-services dns cloudflare cname amazon-lightsail

我在 Namecheap 注册了自己的域 (mydomain.com) 并指向 CloudFlare 名称服务器。

我已经在 AWS Lightsail 容器服务中成功部署了 (Nextjs + Nginx) 容器,它有像 myservice.random.us-west-1.cs.amazonlightsail.com

这样的公共域

我在 CloudFlare DNS 中添加了以下 CNAME 记录:

type: CNAME
name: mydomain.com
target: myservice.random.us-west-1.cs.amazonlightsail.com
ttl: Auto
proxy status: Proxied

type: CNAME
name: www.mydomain.com
target: myservice.random.us-west-1.cs.amazonlightsail.com
ttl: Auto
proxy status: Proxied

SSL/TLS encryption mode: Full

尽管我可以在 CloudFlare 仪表板中看到请求,但我的网站显示“404 No such Service

我做错了什么?

1 个答案:

答案 0 :(得分:0)

您错过了一步。将带有子域名的 cname 添加到您的服务名称示例中: cname subdomain.example.com service.ramdom.us-east-1.cs.amazonlightsail.com