本文介绍了S3 - 访问控制 - 允许 - 产地标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人管理,以增加访问控制 - 允许 - 产地的响应头?我需要的是这样的:

did anyone manage to add Access-Control-Allow-Origin to the response headers?what i need is something like this:

<img src="http://360assets.s3.amazonaws.com/tours/8b16734d-336c-48c7-95c4-3a93fa023a57/1_AU_COM_180212_Areitbahn_Hahnkoplift_Bergstation.tiles/l2_f_0101.jpg" />

这get请求应包含在响应头访问控制 - 允许 - 产地:*

this get request should contain in the response headers Access-Control-Allow-Origin: *

我CORS设置桶看起来是这样的:

my CORS settings for the bucket looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

为u所料,没有产地响应头:(

as u might expect there is no Origin response header :(

拉​​雷什

推荐答案

要编辑您的S3存储权限:

To edit your S3 bucket permissions:

1)登录到AWS管理控制台,打开Amazon S3的控制台在 HTTPS://console.aws.amazon。 COM / S3 /

1) Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/

2)在桶列表中,打开您要查看,然后单击添加CORS的配置其属性的斗

2) In the Buckets list, open the bucket whose properties you want to view and click "add CORS configuration"

3)写你愿意添加的标记之间的规则&LT; CORSConfiguration&GT;

3) Write the rules you are willing to add in between the tags <CORSConfiguration>

<CORSConfiguration>
  <CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
  </CORSRule>
</CORSConfiguration>

您可以了解更多有关规则为:http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

You can learn more about rules at: http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

这篇关于S3 - 访问控制 - 允许 - 产地标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 20:52