简体   繁体   English

Amazon S3 - 每个子域有一个文件夹的 1 个存储桶?

[英]Amazon S3 - 1 bucket with a folder per sub-domain?

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.我从来没有这样做过,所以如果这个问题听起来有点太基本了,请原谅我。

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 或 Google 云存储之类的东西中,以将其与我的服务器分开,使其可扩展并保护所有文件。

While considering Amazon S3 I noticed a user account is limited to 100 buckets .在考虑 Amazon S3 时,我注意到一个用户帐户被限制为 100 个存储桶 So I can't just use a bucket per customer.所以我不能只为每个客户使用一个桶。

I guess, I could use 1 bucket for multiple users by just creating folders in it and pointing each folder to a different subdomain?我想,我可以通过在其中创建文件夹并将每个文件夹指向不同的子域来为多个用户使用 1 个存储桶?

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?这不会是这里的问题吗?

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.您可以这样做,每个网站一个存储桶,一个文件夹 - 但您随后会使用 aws cloudfront 来提供数据,而不是直接使用 s3 - 自定义域将指向 cloudfront,而 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.您是对的,有 100 个存储桶限制(无需请求更多),并且存储桶名称必须与域名完全匹配(这可能是一个问题),但是如果您使用我提到的 Cloudfront 解决方案,则这些限制不适用以上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM