Amazon S3-每个子域有1个存储桶并带有一个文件夹? [英] Amazon S3 - 1 bucket with a folder per sub-domain?

查看:54
本文介绍了Amazon S3-每个子域有1个存储桶并带有一个文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个服务,该服务允许用户在自定义子域中发布静态页面.我从来没有这样做过,所以如果这个问题听起来有点太基础了,请原谅.

I need to create a service that allows users to publish a static page in a custom subdomain. I've never done this so excuse me if the question sounds a bit too basic.

为此,我想将所有这些静态文件托管在Amazon S3或Google Cloud Storage之类的文件中,以将其与服务器分离,使其具有可伸缩性并保护所有文件.

To do so, I would like to host all those static files in something like Amazon S3 or Google cloud Storage to separate it from my server, make it scalable and secure it all.

在考虑使用Amazon S3时,我注意到一个用户帐户仅限于100桶.所以我不能只为每个客户使用一个存储桶.

While considering Amazon S3 I noticed a user account is limited to 100 buckets. So I can't just use a bucket per customer.

我想,我可以通过在其中创建文件夹并将每个文件夹指向不同的子域来为多个用户使用1个存储桶?

I guess, I could use 1 bucket for multiple users by just creating folders in it and pointing each folder to a different subdomain?

这听起来像是解决此问题的合适方法吗?

Does this sound like a proper solution to this problem?

我正在阅读只是将任何子域指向任何存储桶?两个名字应该是相同的吗?这不是问题吗?

I was reading you can't just point any subdomain to any bucket? Both names should be the same? Wouldn't this be a problem here?

推荐答案

您可以做到这一点,一个存储桶,每个网站一个文件夹-但是您将使用aws cloudfront而不是s3直接提供数据-自定义域将指向cloudfront,并且cloudfront每个网站的分布都不同(这将是单个存储桶下的匹配文件夹)-听起来并不那么复杂,并且可能是您想要做的最好的方法.

You can do it, one bucket, one folder per website - but you would then use aws cloudfront to serve the data instead of s3 directly - the custom domain would point to cloudfront, and cloudfront would have a different distribution for each website (which would be the matching folder under the single bucket) - not as complicated as it sounds, and is probably the best way to do what you want.

不过,您是对的,存储桶限制为100(没有更多请求),并且存储桶名称必须与域名完全匹配(这可能是一个问题),但是如果您使用cloudfront,则这些限制将不适用我上面提到的解决方案.

You are correct though, there is a 100 bucket limit (without requesting more), and the bucket name must match the domain name exactly (which can be a problem), but those restrictions don't apply if you use the cloudfront solution I mentioned above.

这篇关于Amazon S3-每个子域有1个存储桶并带有一个文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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