Problem description
The request is denied by the hotlink protection configuration of the bucket.
Causes
The value of the Referer header in the request is not in the Referer whitelist that is configured for the bucket.
Examples
For example, you want to access a bucket that has the following Referer configuration:
<RefererConfiguration>
<AllowEmptyReferer>false</AllowEmptyReferer>
<RefererList>
<Referer>http://*.aliyuncs.com</Referer>
</RefererList>
<RefererBlacklist>
<Referer>http://abc.aliyuncs.com</Referer>
</RefererBlacklist>
</RefererConfiguration
You initiate the following request:
GET /test.txt HTTP/1.1
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: BucketName.oss-example-endpoint.aliyuncs.com
Referer: http://test.com
Your request is denied because the value of the Referer header in the request is not in the Referer whitelist specified in the RefererList
configuration of the bucket.
Solutions
Include an allowed Referer in the request, as shown in the following sample request:
GET /test.txt HTTP/1.1
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: BucketName.oss-example-endpoint.aliyuncs.com
Referer: http://test.aliyuncs.com
If you are the owner of a bucket, you can modify the Referer configuration of the bucket to allow access from specified Referers. For more information, see Hotlink protection.