简体   繁体   English

我在 AWS ECS 上部署了一个 react 应用程序并购买了一个自定义域,但我无法在域名前加上“www”访问它

[英]I deployed a react app to AWS ECS and bought a custom domain, but I can not access it with “www” before the domain name

so I can do "domain.com"所以我可以做“domain.com”

but I cannot do "www.domain.com"但我不能做“www.domain.com”

additionally, when I add "https" to the beginning I get a "connection not private" message, however I have a public cert from amazon.此外,当我在开头添加“https”时,我收到“连接不是私人”消息,但是我有来自亚马逊的公共证书。

any ideas what's up with either problem?任何想法这两个问题是怎么回事?

The www part is a subdomain of domain.com . www部分是domain.com的子域。 You will need to handle routing when users visit this subdomain.当用户访问此子域时,您将需要处理路由。 You can either serve the same files as on the root domain, or you can redirect to domain.com .您可以提供与根域相同的文件,也可以重定向到domain.com

To access your site via https you need to configure SSL.要通过https访问您的站点,您需要配置 SSL。

You can use CloudFront and Route53 to solve these issues.您可以使用 CloudFront 和 Route53 来解决这些问题。

Here is a guide on handling routing for subdomains in Route53.这是在 Route53 中处理子域路由的指南

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

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