编辑 CORS 策略 - AWS Elemental MediaStore

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

编辑 CORS 策略

跨源资源共享 (CORS) 定义了在一个域中加载的客户端 Web 应用程序与另一个域中的资源交互的方式。

编辑 CORS 策略(控制台)
  1. 打开 MediaStore 控制台,网址为 https://console.aws.amazon.com/mediastore/

  2. Containers (容器) 页面上,选择要编辑其 CORS 策略的容器的名称。

    此时将显示容器详细信息页面。

  3. Container CORS policy (容器 CORS 策略) 部分中,选择 Edit CORS policy (编辑 CORS 策略)

  4. 更改策略,然后选择 Save (保存)

编辑 CORS 策略 (AWS CLI)
  1. 创建一个定义更新 CORS 策略的文件:

    [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "HEAD" ], "AllowedOrigins": [ "https://www.example.com" ], "MaxAgeSeconds": 3000 } ]
  2. 在 AWS CLI 中,使用 put-cors-policy 命令。

    aws mediastore put-cors-policy --container-name ExampleContainer --cors-policy file://corsPolicy2.json --region us-west-2

    此命令没有返回值。