亚马逊S3:静态网站:自定义域或子 [英] Amazon S3: Static Web Sites: Custom Domain or Subdomain

查看:190
本文介绍了亚马逊S3:静态网站:自定义域或子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Amazon.com刚刚宣布,一个可容纳在S3存储桶的静态网站。我去他们设置页面,在<一个href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteHosting.html">http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteHosting.html并创建了一个斗我的静态网站,它工作得很好。我有形式为http的URL:// [我斗名称] .S3 - 网站 - 美东1.amazonaws.com /。

Amazon.com just announced that one can host static web sites in a S3 bucket. I went to their setup page at http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?WebsiteHosting.html and created a bucket for my static web site, and it worked fine. I have an URL of the form http://[my bucket name].s3-website-us-east-1.amazonaws.com/.

不过,我想指出,我自己一个子域(例如static.mydomain.com)到我的静态网站亚马逊S3。有没有人想出如何做到这一点?

However, I would like to point a subdomain that I own (e.g. static.mydomain.com) to my static web site at Amazon S3. Has anybody figured out how to do that?

我AP preciate任何帮助,您可以给我。

I appreciate any help you can give me.

推荐答案

事实证明,使其工作,你不能任意的子域只映射到任意桶。 的完全限定子域名必须是相同S3存储桶名称

It turns out that to make it work, you cannot just map any arbitrary subdomain to any arbitrary bucket. The fully qualified subdomain name must be the same as the S3 bucket name.

  1. 假设你的网站的名称是 static.mydomain.com 。然后,你需要创建一个S3存储具有相同名称,命名为 static.mydomain.com
  2. 一旦配置了水桶为S3静态网站,它有一个看起来像的 <一个分配给它一个网址href="http://static.mydomain.com.s3-website-us-east-1.amazonaws.com">http://static.mydomain.com.s3-website-us-east-1.amazonaws.com.
  3. 转到您的域名主机和子域从第2步在enom.com,这意味着映射主机映射到URL的静态的地址 static.mydomain.com.s3-website-us-east-1.amazonaws.com 作为一个CNAME记录。
  1. Suppose the name of your site is static.mydomain.com. Then you need to create a S3 bucket with that same name, named static.mydomain.com.
  2. Once you configure that bucket as a S3 static web site, it will have a URL assigned to it that looks something like http://static.mydomain.com.s3-website-us-east-1.amazonaws.com.
  3. Go to your domain host and map your subdomain to the URL from step 2. In enom.com, that meant mapping the host "static" to the address "static.mydomain.com.s3-website-us-east-1.amazonaws.com" as a CNAME record.

由于乌利亚和的大卫,获取建议。我终于得到了答案,在一个亚马逊AWS论坛

Thanks to Uriah and David for suggestions. I eventually got my answer at an Amazon AWS forum.

这篇关于亚马逊S3:静态网站:自定义域或子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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