为非静态(网站)s3 存储桶编辑 url?

Edit url for non static (website) s3 bucket?

我创建了一个名为 "test.download.abc.com" 的 S3 存储桶。此存储桶的目的是在用户单击 link Download to download the file. Here the href attribute as one can see is "https://s3-us-west-2.amazonaws.com/test.download.abc.com/MyFolder/MyClient.exe"

时简单地提供可执行文件 (exe)

我的目的是将用户悬停时看到的 url 更改为“http://test.download.abc.com/MyFolder/MyClient.exe” - 实现它的一种方法是在 href 和单击时将其重定向到下载文件 - 正在运行。

我想知道我是否可以在 AWS "Route 53" 上创建任何记录集 "Cname" 或 "Alias" 来实现相同的目的。我阅读了有关需要将存储桶配置为静态站点的虚拟托管文章——除了没有默认站点页面外,这似乎不适合我的目的。我实现相同目标的正确方法是什么?谢谢大家

如果您不想走静态站点路线,您可以设置一个云端分发来为您的 s3 存储桶的内容提供服务,然后设置一个自定义名称。

更多信息在这里: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

In CloudFront, an alternate domain name, also known as a CNAME, lets you use your own domain name (for example, www.example.com) for links to your objects instead of using the domain name that CloudFront assigns to your distribution. Both web and RTMP distributions support alternate domain names.

When you create a distribution, CloudFront returns a domain name for the distribution, for example:

d111111abcdef8.cloudfront.net

When you use the CloudFront domain name for your objects, the URL for an object called /images/image.jpg is:

http://d111111abcdef8.cloudfront.net/images/image.jpg

If you want to use your own domain name, such as www.example.com, instead of the cloudfront.net domain name that CloudFront assigned to your distribution, you can add an alternate domain name to your distribution for www.example.com. You can then use the following URL for /images/image.jpg:

http://www.example.com/images/image.jpg

不需要 CloudFront 来满足您的要求,您可以只启用 S3 以按此处所述提供静态 Web 内容

http://docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConfiguration.html

您还需要为您的存储桶配置带有 CNAME 或 A 别名记录的 Route 53

查看结合了 S3 和 Route 53 的示例:http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

这里的解决方案看似简单。

您需要做的就是在您的 DNS 服务器中将主机名设置为引用存储桶的 REST 端点虚拟主机名的 CNAME。

对于 "example.com" DNS 区域中名为 "bucket.example.com," 的存储桶,添加:

bucket  IN  CNAME  bucket.example.com.s3.amazonaws.com.

[...] the bucket for the request is the lowercase value of the Host header, and the key for the request is the Request-URI. This interpretation is useful when you have registered the same DNS name as your bucket name and have configured that name to be a CNAME alias for Amazon S3

http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html

这与静态网站托管不同。它使用 CNAME 直接引用存储桶的 REST 端点。当然,这仅适用于子域,因为 CNAME 不属于域的顶点。