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

preguntada hace 9 meses2104 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace 9 meses
profile picture
EXPERTO
Steve_M
revisado hace 9 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas