gpt4 book ai didi

asp.net - Amazon S3 Url 重写

转载 作者:行者123 更新时间:2023-12-04 00:00:39 27 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




如何从 http://bucket.amazons3.com/imagepath.jpg 更改 Amazon S3 url至 http://image.mydomain.com/imagepath.jpg

编辑:
基本上,这样做的全部原因是对我的用户隐藏 amazon s3 url。

我正在考虑一个 HttpModule,它将请求从 image.mydomain.com 重定向到 bucket.amazons3.com。但这需要首先由我的服务器处理所有请求,然后转发。

最佳答案

如果我理解,您需要指定您的域名而不是 S3。为此,您需要编写一个处理程序,它将充当亚马逊服务器的代理。

但是,这实际上会使您的带宽加倍,因为您需要将图像发送到客户端以及为 S3 获取图像。

我不确定是否有任何 S3 特定的方法来处理这个问题。

以下是取自 Amazon S3, CNAME record 的 Amazon S3 特定方式

The average user may sign up for Amazon S3 hosting and begin uploading files - accepting the default URL structure for hosted files:

http://s3.amazonaws.com/your-bucket/some-file.txt If you plan on using S3 to host media files - more specifically Flash files - you’ll run into Adobe’s cross domain security policy. The fix requires mapping your hosted S3 files to look as though they are being served from your own domain - virtual hosting. The easiest and most attractive method would be a hosted file URL that like this:

http://s3.your-site.com/some-file.txt To get started, create a bucket on S3 that you want as the root for your hosted files. For this example, your S3 bucket would be:

s3.your-site.com The most important step is adding the appropriate CNAME record to your DNS settings.

Name Type Data s3.your-site.com CNAME s3.amazonaws.com. Expect your new DNS settings to take up to 24-48 hours to resolve.

关于asp.net - Amazon S3 Url 重写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/570890/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com