百度智能云

All Product Document

          CDN Abroad

          Set the Access Referer Control

          Interface

          This interface is used to set the Referer access control.

          Method Path Description
          PUT /v2/abroad/domain/{domain}/config?refererACL Set Referer access control

          Request Body

          Parameter Optional Type Description
          refererACL Required refererACL Set Referer access control
          • RefererACL field description:
          Field Optional Type Description
          blackList No list Blacklist
          whiteList No list Whitelist
          allowEmpty No boolean Null referer is allowed
          • blackList and whiteList cannot exist at the same time.

          Response code(Http Status Code)

          Http Status Code Description
          200 Successfully configured
          400 Format error

          Request example

          PUT /v2/abroad/domain/test.bcecdn.com/config?refererACL HTTP/1.1 
          x-bce-date: 2018-11-21T09:46:38Z 
          Host: cdn.baidubce.com 
          Content-Length: 22
          
          { 
              "refererACL": { 
                  "blackList":["http://www.example.com/*"], 
                  "allowEmpty": true 
              } 
          } 

          Response example

          Server: nginx 
          Date: Wed, 21 Nov 2018 10:45:48 GMT 
          Content-Type: application/json; charset=utf-8 
          Connection: keep-alive 
          x-bce-request-id: a0d6f8aa-7bd2-58dc-f8f1-c4a0f148e5ca
          
          {"requestId":"a0d6f8aa-7bd2-58dc-f8f1-c4a0f148e5ca","code":"success","message":"update referer acl success"}
          Previous
          Set the Cache Parameter Filter Rules
          Next
          Set ip Access Rule Interface