Is a site hosted on S3 just uploading an empty file?

I have a very simple site, literally just an HTML file with some text in it. I set up my hosting bucket and set the main page to index.html. I've set permissions for the AWS tutorial here: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

For some reason, when I got to the site's endpoint, Chrome received a request to save a file named "download". If I save the file and open it, it is just an empty, zero byte. Why is my index.html file not supported?

UPDATE: I fixed the empty file issue, but it still wants to load my page and not open it in the browser ...

FIXED: Content type set incorrectly. When uploading the file, I had to explicitly set the content type property in text / html or text / css.

+3


source to share


1 answer


You need to set the metadata correctly - content-type

just like text/html

for your html pages. Once it's through the browser, you will start rendering pages in the browser rather than loading them.



+4


source







All Articles