OSS provides Cross-Origin Resource Sharing (CORS) in the HTML5 protocol to help users achieve cross-origin access. When OSS receives a cross-origin access request (or OPTIONS request) for a bucket, it reads the CORS rules for the bucket and then checks relevant permissions. OSS matches the rules with the request in sequence, uses the first rule that matches to allow the request, and returns the corresponding header. If none of the rules match the request, no CORS header is carried in the returned result.
- Log on to the OSS console.
- In the left-side bucket list, click the name of the bucket that you want to configure CORS rules.
- Click the Basic Settings tab. In the Cross-Origin Resource Sharing (CORS) area, click Configure.
- Click Create Rule. In the CORS Rule dialog box, set the following parameters:
- Click OK.
Note You can also edit or delete an existing rule.