如何将域定向到 aws s3 存储桶上的子文件夹?
How do I direct a domain to a subfolder on an aws s3 bucket?
我在 bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder/
有一个 aws s3 存储桶
我想将域直接路由到子文件夹 /subfolder/static-site-folder/
这是因为我想在一个存储桶上有多个静态站点。
所以我想要这样的东西
示例-domain.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-1/
示例域-2.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-2/
示例域-3.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-3/
aws有解决办法吗?或者我唯一的选择是使用 Kubernetes 设置代理服务器来路由流量?
域名系统 (DNS) Web 服务提供商(例如 Route53)不会“看到”您的文件夹。它们仅在域级别运行,但 url 路径。
可能最简单的方法是为您的文件夹设置 CloudFront distro for your S3 并指定 Origin Path
:
If you want CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin, enter the directory name here, beginning with a /. CloudFront appends the directory name to the value of Origin Domain Name when forwarding the request to your origin, for example, myawsbucket/production. Do not include a / at the end of the directory name.
我在 bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder/
我想将域直接路由到子文件夹 /subfolder/static-site-folder/
这是因为我想在一个存储桶上有多个静态站点。
所以我想要这样的东西
示例-domain.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-1/
示例域-2.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-2/
示例域-3.com -> bucket.com.s3-website.us-east-2.amazonaws.com/subfolder/static-site-folder-3/
aws有解决办法吗?或者我唯一的选择是使用 Kubernetes 设置代理服务器来路由流量?
域名系统 (DNS) Web 服务提供商(例如 Route53)不会“看到”您的文件夹。它们仅在域级别运行,但 url 路径。
可能最简单的方法是为您的文件夹设置 CloudFront distro for your S3 并指定 Origin Path
:
If you want CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin, enter the directory name here, beginning with a /. CloudFront appends the directory name to the value of Origin Domain Name when forwarding the request to your origin, for example, myawsbucket/production. Do not include a / at the end of the directory name.