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달 전2170회 조회
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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠