Amazon S3静态托管自定义域 [英] Amazon S3 Static Hosting Custom Domain
问题描述
我正在学习一些Web开发,并且正在将Amazon S3用作具有来自Google域的自定义域的Web主机.我使用了Amazon AWS页面上的指南,并且能够设置网页,但是在使自定义域正常工作方面存在问题.
I'm learning some web development and am using Amazon S3 as a web host with a custom domain from Google domains. I used the guides from the Amazon AWS page and was able to set up the web page but I have a problem with getting the custom domain to work.
例如,Amazon S3的端点URL为www.example.com.s3-website-us-east-1.amazonaws.com,我希望显示我的域example.com.当我加载www.example.com的页面时,它加载了页面,但是当我希望它显示简单的example.com时,它仍然显示example.s3-website-us-east-1.amazonaws.com.
For example, Amazon S3 has the endpoint URL to www.example.com.s3-website-us-east-1.amazonaws.com and I want my domain example.com to show up. When I load the page for www.example.com, it loads the page however it still shows the example.s3-website-us-east-1.amazonaws.com when I want it to show the simple example.com instead.
据我所知,我需要一个CNAME,并将其设置为www.example.com->具有永久重定向的www.example.com.s3-website-us-east-1.amazonaws.com (301)和前进路径.
From what I can tell, I need a CNAME, I've set it up as www.example.com -> www.example.com.s3-website-us-east-1.amazonaws.com with permanent redirect (301) and forward path.
请帮助!
推荐答案
如果有人想知道如何使用它,我最终使用了Cloudflare及其免费的DNS选项.我将DNS服务器添加到google域中,然后添加了两个CNAME:
If anyone was wondering how I got it to work, I ended up using Cloudflare with its free DNS options. I added the DNS servers to google domains and then added two CNAMES:
@ -> example.com -> example.com.s3-website-us-east-1.amazonaws.com (for the root)
CNAME -> www -> www.example.com.s3-website-us-east-1.amazonaws.com (for the www redirect)
这篇关于Amazon S3静态托管自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!