Custom domain for s3 bucket?

≯℡__Kan透↙ 提交于 2020-12-02 17:31:40

问题


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

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).

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

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


回答1:


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

The bucket name must be the same as the CNAME



来源:https://stackoverflow.com/questions/25667252/custom-domain-for-s3-bucket

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!