s3存储桶的自定义域? [英] Custom domain for s3 bucket?

查看:81
本文介绍了s3存储桶的自定义域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为"mybucket"的S3存储桶.可以从以下链接获得来自那里的文件:

I have S3 bucket called "mybucket". Files from there are available under following links:

  1. mybucket.s3.amazonaws.com/path/to/file.jpg
  2. s3.amazonaws.com/mybucket/path/to/file.jpg

我需要自定义域来存储s3提供的文件.我将指向 images.mydomain.com 的DNS CNAME记录添加到了 s3.amazonaws.com (也尝试了 images.mydomain.com-> mybucket.s3.amazonaws.com ).

I need custom domain for files served from s3. I added DNS CNAME record pointing to from images.mydomain.com to s3.amazonaws.com (also tried images.mydomain.com -> mybucket.s3.amazonaws.com).

在两种情况下,当我尝试获取 images.mydomain.com/mybucket/path/to/file/jpg (或 images.mydomain.com/path/to/file.jpg ),我收到类似S3的错误

In both cases when I try to GET images.mydomain.com/mybucket/path/to/file/jpg (or images.mydomain.com/path/to/file.jpg) I get S3 error like

Bucket 'images.mydomain.com' does not exist

是否有解决方法,或者我必须将存储桶名称更改为 images.mydomain.com ?

Is there any workaround for this or I have to change bucket name to images.mydomain.com?

推荐答案

您需要更改存储桶名称.虚拟主机文档专门说(在自定义Amazon S3带有CNAME的网址"部分)

You need to change the bucket name. The virtual hosting docs specifically say (in the "Customizing Amazon S3 URLs with CNAMEs" section)

存储桶名称必须与CNAME相同

The bucket name must be the same as the CNAME

这篇关于s3存储桶的自定义域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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