Amazon S3 downloads index.html instead of serving

后端 未结 5 1223
感情败类
感情败类 2020-12-05 12:35

I\'ve set up Amazon S3 to serve my static site, speakeasylinguistics.com. All of the DNS stuff seems to be working okay, because dig +recurse +trace www.s

5条回答
  •  萌比男神i
    2020-12-05 13:23

    If you are using Hashicorp Terraform you can specify the content-type on an aws_s3_bucket_object as follows

    resource "aws_s3_bucket_object" "index" {
      bucket = "yourbucketnamehere"
      key = "index.html"
      content = "

    Hello, world

    " content_type = "text/html" }

    This should serve your content appropriately in the browser.

提交回复
热议问题