Amazon S3 下载 index.html 而不是提供服务 [英] Amazon S3 downloads index.html instead of serving
问题描述
我已经设置了 Amazon S3 来为我的静态网站 speakeasylinguistics.com
提供服务.所有 DNS 内容似乎都运行正常,因为 dig +recurse +trace www.speakeasylinguistics.com
输出正确的 DNS 信息.
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.speakeasylinguistics.com
outputs the correct DNS info.
但是当您在浏览器中访问该网站时使用端点,index.html
页面下载,而不是被提供.我该如何解决这个问题?
But when you visit the site in a browser using the endpoint, the index.html
page downloads, instead of being served. How do I fix this?
我尝试过 Chrome、Safari、FF.它发生在所有人身上.我使用了 亚马逊的演练将自定义域托管到 T.
I've tried Chrome, Safari, FF. It happens on all of them. I used Amazon's walkthrough on hosting a custom domain to a T.
推荐答案
针对您发布的 url 运行 curl -I 会得到以下结果:
Running curl -I against the url you posted gives the following result:
curl -I http://speakeasylinguistics.com.s3-website-us-east-1.amazonaws.com/
HTTP/1.1 200 OK
x-amz-id-2: DmfUpbglWQ/evhF3pTiXYf6c+gIE8j0F6mw7VmATOpfc29V5tb5YTeojC68jE7Rd
x-amz-request-id: E233603809AF9956
Date: Sun, 18 Aug 2013 07:58:55 GMT
Content-Disposition: attachment
Last-Modified: Sun, 18 Aug 2013 07:05:20 GMT
ETag: "eacded76ceb4831aaeae2805c892fa1c"
Content-Type: text/html
Content-Length: 2585
Server: AmazonS3
这一行是罪魁祸首:
Content-Disposition: attachment
如果您使用的是 AWS 控制台,我相信可以通过在 S3 中选择文件并通过删除此属性修改其元数据来更改这一点.
If you are using the AWS console, I believe this can be changed by selecting the file in S3 and modifying its meta data by removing this property.
这篇关于Amazon S3 下载 index.html 而不是提供服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!