S3的静态网站托管与我的域名:为什么AWS手册不为我工作? [英] S3 static site hosting with my domain: why aws manual doesn't work for me?

查看:150
本文介绍了S3的静态网站托管与我的域名:为什么AWS手册不为我工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了很多的手册对于这个问题,特别是<一href="https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html"相对=nofollow> AWS的官方文档,但它不为我工作,我上无法理解为什么。

  1. 在我创建了两个水桶mydomain.com和www.mydomain.com。
  2. 我加水桶政策mydomain.com:

    {     版本:2012年10月17日,     声明: [         {             锡德:AddPerm             效果:允许,             校长:的,             行动:S3:GetObject的,             资源:ARN:AWS:S3 ::: mydomain.com / 的         }     ] }

  3. 我启用启用网站托管为mydomain.com,并把那里的index.html。所以,我有终点为它mydomain.com.s3-website-us-east-1.amazonaws.com这在开放的index.html不错。

  4. 我启用了重定向所有请求到另一台主机名www.mydomain.com到mydomain.com.s3-website-us-east-1.amazonaws.com。但是根据AWS的官方我应该做的重定向到mydomain.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与AWS route53,所以我去了那里,并创建一个别名s3-website-us-east-1.amazonaws.com exacly像文档。我已经等了24小时,但没有任何变化......

    mydomain.com去无处...帮助,请。

解决方案

你在做什么的基础似乎权利;然而,我怀疑你错过了一步,这是很难没有看到实际的记录/的configs告诉在哪里。

例如,如果该网站是静态的,对CloudFront的,请确保您的CloudFront的设置备用域名除了MYDOMAIN来指向您的域名存在。

此外,它会知道你的route53条目被解析到这是根本没有反应,或者route53域名并没有解决所有的地址有帮助的。为了做到这一点,你会做MYDOMAIN进行nslookup操作和后的结果。

另外,看到这些,他们可能会有所帮助:的http://文档.aws.amazon.com / AmazonCloudFront /最新/ DeveloperGuide / CNAMEs.html

<一个href="http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html" rel="nofollow">http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html

I've seen a lot of manuals about this question and especially AWS' official docs but it doesn't work for me and I cann't understand why.

  1. I created two buckets mydomain.com and www.mydomain.com.
  2. I added bucket policy to 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. So I've got endpoint for it mydomain.com.s3-website-us-east-1.amazonaws.com which good in opening 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. But according to AWS' official I should do redirect to 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.

  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. I have been waiting for 24 hours, but nothing changes...

    mydomain.com goes to nowhere... Help, please.

解决方案

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.

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. To do that, you would do an nslookup on mydomain and post the results.

Also, see these, they might help: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

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

这篇关于S3的静态网站托管与我的域名:为什么AWS手册不为我工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆