简体   繁体   English

使用我的域托管 S3 静态站点:为什么 aws 手册对我不起作用?

[英]S3 static site hosting with my domain: why aws manual doesn't work for me?

I've seen a lot of manuals about this question and especially AWS' official docs but it doesn't work for me and I can't understand why.我看过很多关于这个问题的手册,尤其是AWS 的官方文档,但它对我不起作用,我不明白为什么。

  1. I created two buckets mydomain.com and www.mydomain.com .我创建了两个存储桶 mydomain.com 和www.mydomain.com

  2. I added bucket policy to mydomain.com:我将存储桶策略添加到 mydomain.com:

     { "Version": "2012-10-17", "Statement": [ { "Sid": "AddPerm", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mydomain.com/*" } ] }
  3. I enabled "Enable website hosting" for mydomain.com and put index.html there.我为 mydomain.com 启用了“启用网站托管”并将 index.html 放在那里。 So I've got endpoint for it mydomain.com.s3-website-us-east-1.amazonaws.com which good in opening index.html.所以我有它的端点 mydomain.com.s3-website-us-east-1.amazonaws.com,它可以很好地打开 index.html。

  4. I enabled "Redirect all requests to another host name" for www.mydomain.com to mydomain.com.s3-website-us-east-1.amazonaws.com.我为www.mydomain.com启用了“将所有请求重定向到另一个主机名”到 mydomain.com.s3-website-us-east-1.amazonaws.com。 But according to AWS' official I should do redirect to mydomain.com.但根据 AWS 官方的说法,我应该重定向到 mydomain.com。 But it doesn't work for me, and my way of redirect does.但这对我不起作用,我的重定向方式也适用。 Anyway now www.mydomain.com.s3-website-us-east-1.amazonaws.com opens index.htm in mydomain.com.s3-website-us-east-1.amazonaws.com.无论如何,现在www.mydomain.com.s3-website-us-east-1.amazonaws.com在 mydomain.com.s3-website-us-east-1.amazonaws.com 中打开 index.htm。

  5. Mydomain registred with AWS route53, so I went there and created A Alias to s3-website-us-east-1.amazonaws.com exacly like in docs. Mydomain 注册了 AWS route53,所以我去那里创建了 s3-website-us-east-1.amazonaws.com 的别名,就像在文档中一样。 I have been waiting for 24 hours, but nothing changes...我已经等了24小时,但没有任何改变......

mydomain.com goes to nowhere. mydomain.com 无处可去。

The basics of what you are doing seem right;您正在做的事情的基础似乎是正确的; however, I suspect you missed a step and it is hard to tell where without seeing the actual records/configs.但是,我怀疑您错过了一步,如果没有看到实际的记录/配置,很难分辨出哪里。

For example, if the site is static and on cloudfront, make sure that you set the 'alternate domain name' in cloudfront to mydomain in addition to pointing your domain there.例如,如果站点是静态的并且位于云端,请确保将云端的“备用域名”设置为 mydomain,并将您的域指向那里。

Also, it would be helpful to know if your route53 entry is resolving to an address which is simply not responding, or if the route53 domain is not resolving at all.此外,如果您的 route53 条目解析到一个根本没有响应的地址,或者 route53 域是否根本没有解析,这将很有帮助。 To do that, you would do an nslookup on mydomain and post the results.为此,您将在 mydomain 上执行 nslookup 并发布结果。

Also, see these, they might help: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html另外,请参阅这些,它们可能会有所帮助: http ://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法使用我的域来处理S3静态网站托管 - I can't handle S3 static site hosting with my domain 为什么S3虚拟主机会将我重定向到一个未知位置? - Why the S3 web hosting redirects me to an unknwn location? 未通过 CloudFront 分配为请求激活 AWS S3 静态网站托管重定向 - AWS S3 static website hosting redirects not activated for requests via CloudFront distribution S3静态网站托管使用QueryString重定向 - S3 Static Website Hosting redirect with QueryString 包含静态页面的AWS S3重定向 - AWS S3 redirect containing static pages 如何将根域指向提供 S3 静态站点的 CloudFront 分配? 我在 Google Domains 上 - How do I point a root domain to a CloudFront distribution serving up S3 static site? I'm on Google Domains .htaccess重写规则在我的网站上不起作用 - .htaccess Rewrite Rule doesn't work on my site 为什么我的 wordpress 网站会重定向到托管公司网站? - Why is my wordpress site redirecting to the hosting company site? 为什么我的浏览器使用此URL重定向我,而Python却没有呢? - Why do my browsers redirect me with this URL, but Python doesn't? S3 静态网站通过 Route 53。如果路径不存在,则重定向到页面 - S3 Static Website through Route 53. Redirect to page if path doesn't exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM