Cloudfront distribution downloading instead of showing content

0

I'm trying to get a very simple website up and running using cloudfront and s3 from AWS. I managed to configure everything, but when I access my page, instead of showing the file content, it downloads the content. can you help me? Thanks in advance.

Below are some things that may help:

Bucket Policy:

Enter image description here

Origin configuration in cloudfront:

Enter image description here

質問済み 9ヶ月前2169ビュー
1回答
1
承認された回答

Hello.
The content type of the object placed in S3 may not be "text/html".
Try changing the content type with the following command.

aws s3 cp --content-type text/html s3://your-bucket-name/index.html s3://your-bucket-name/index.html --recursive

Also, delete the CloudFront cache after making the change.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#Invalidation_Requests

profile picture
エキスパート
回答済み 9ヶ月前
profile picture
エキスパート
Steve_M
レビュー済み 9ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ