Configuring CORS
Object Storage lets you manage CORS configurations in buckets.
Management console
AWS CLI
- In the management console, go to the bucket you want to configure CORS for.
- In the left pane, select CORS.
- Click Configure CORS.
- A page opens where you can add, delete, and edit configuration rules. For a detailed description of the configuration fields, see CORS configuration of buckets.
To upload a configuration via the AWS CLI:
-
Describe the CORS configuration of objects in JSON format. For example:
{ "CORSRules": [ { "AllowedHeaders": ["*"], "AllowedMethods": ["GET", "HEAD", "PUT", "DELETE"], "MaxAgeSeconds": 3000, "AllowedOrigins": ["*"] } ] }
When you're done, you can save your configuration as a file, like
cors.json
. -
Upload the configuration to a bucket, like
shared-bucket
:aws s3api put-bucket-cors \ --bucket shared-bucket \ --cors-configuration file://cors.json \ --endpoint-url=https://storage.yandexcloud.net