Lightsail容器作为CloudFront Origin返回HTTP 404 Not Found错误

0

【以下的问题经过翻译处理】 我已经创建并部署了一个Lightsail容器,并通过一个带有类似于containerservicename.123456abcdef.us-west-2.cs.amazonlightsail.com域名的HTTPS协议公开访问。

我创建了一个CloudFront分配,并将Lightsail容器的域名设置为HTTPS自定义源站。但是,当我访问CloudFront分配时,返回了HTTP 404 Not Found的错误。为什么会这样呢?

我使用普通的CloudFront分配,而不是直接访问Lightsail,是因为我需要利用Lambda@Edge函数。

profile picture
EXPERT
demandé il y a 6 mois10 vues
1 réponse
0

【以下的回答经过翻译处理】 我已经通过使用AWS CLI将CloudFront分配的域名添加到我的Lightsail容器服务来解决了这个问题,具体操作见https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-adding-distribution-default-domain-to-container-service

这只能通过CLI完成。

aws lightsail update-container-service --service-name ContainerServiceName --public-domain-names '{"_": ["example123.cloudfront.net"]}'
profile picture
EXPERT
répondu il y a 6 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions