Similar Question: Amazon S3 downloads index.html instead of serving
I am trying to upload a directory to my S3, when I upload manually I can see as static web page. But when I upload using curl, the index.html is getting downloaded.
When I curl my request curl -I https://s3-eu-west-1.amazonaws.com/bucket_name/index.html
, I can see
HTTP/1.1 200 OK
x-amz-id-2: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
x-amz-request-id: XXXXXXXXXXXXXXXX
Date: Fri, 15 Mar 2019 21:03:50 GMT
Last-Modified: Fri, 15 Mar 2019 20:53:05 GMT
ETag: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Accept-Ranges: bytes
Content-Type: text/html
Content-Length: 48210
Server: AmazonS3
But still the index.html is downloading.
You must configure the relevant bucket for website hosting: