如何为 s3 存储桶指定子域? [英] how appoint a subdomain for a s3 bucket?
问题描述
早上好,
我使用 amazon s3 存储桶作为图像服务器.我想使用我网站的子域,如何解决这个存储桶.例如:图片现在位于:https://s3-sa-east-1.amazonaws.com/nomeBucket/pasta/imag.png,我通过相同的链接访问它.
I am using amazon s3 bucket as the image server. And I want to use a subdomain of my site, how to address this bucket. eg: a picture is now in: https://s3-sa-east-1.amazonaws.com/nomeBucket/pasta/imag.png, and I access it through this same link.
会是这样吗:imagens.mydomain.com.br/文件夹/imag.png有什么办法可以做到这一点吗?为存储桶指定子域地址?我已经尝试过亚马逊路线 53,作为 CNAME.我试过了:https://s3-sa-east-1.amazonaws.com/nomeBucket/
Would that it were so: imagens.mydomain.com.br / folder / imag.png Is there any way I can do this? appoint a subdomain address to a bucket? I've tried the amazon route 53, as CNAME. I tried this: https://s3-sa-east-1.amazonaws.com/nomeBucket/
我昨天参加了考试,但显然没有用.有人已经做过类似的事情,和/或知道如何帮助我?
I took the test yesterday, but apparently it did not work. Someone already did something similar, and / or know how to help me?
注意:我使用的是 nginx.还需要为子域配置吗?
Note: I'm using nginx. also need to configure it for subdomain?
谢谢
推荐答案
您需要重命名您的存储桶以匹配自定义域名(例如 imagens.mydomain.com.br
)并进行设置域作为 CNAME 到
You need to rename your bucket to match the custom domain name (e.g. imagens.mydomain.com.br
) and set up that domain as a CNAME to
(在您的情况下 imagens.mydomain.com.br.s3.amazonaws.com.
此处提供完整说明:
http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
这篇关于如何为 s3 存储桶指定子域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!