【问题标题】:Is there any option to set cors (Cross Origin Resouce Sharing) through s3cmd tool?是否有任何选项可以通过 s3cmd 工具设置 cors(跨源资源共享)?
【发布时间】:2015-09-27 21:17:46
【问题描述】:

s3cmd http://s3tools.org/ 中是否有任何命令可以设置 cors(跨源资源共享)

我已经检查了这些网站。

http://www.bucketexplorer.com/documentation/amazon-s3--manage-cross-origin-resource-sharing.html

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

有没有可以设置cors规则的命令?

谢谢

【问题讨论】:

    标签: linux amazon-s3 cloud s3cmd


    【解决方案1】:

    对于您选择的工具,the S3cmd usage documentation 似乎有这个命令:

    s3cmd setcors 文件 s3://BUCKET

    否则:

    AWS put-bucket-cors Documentation 可能是你要找的?

    使用

    aws s3api put-bucket-cors --generate-cli-skeleton >cors.json

    创建一个json输入文件,编辑后可以使用:

    aws s3api put-bucket-cors --bucket [bucket name] --cors-configuration file://cors.json

    覆盖存储桶的现有 cors 配置。

    我只使用我的 cors.json 根 {} 中的“CORSRules”节,因为其他所有内容都由 cli 处理。

    【讨论】:

      猜你喜欢
      • 2015-08-31
      • 2013-01-12
      • 2017-10-06
      • 1970-01-01
      • 2016-03-03
      • 2014-01-18
      • 2014-10-08
      • 2014-03-20
      相关资源
      最近更新 更多