> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/cn/content-delivery-network/domain-management/access-control/referer-restrictions.md).

# Referer 限制

基于 Referer 的防盗链保护是指基于 Referer 标头的访问控制。

例如，您可以配置一个 Referer 白名单，以允许只有特定的请求能够访问您的资源，或者配置一个黑名单以阻止特定的请求。基于 Referer 的防盗链保护能够识别和过滤用户身份，从而保护您的资源免受未授权访问。

<div align="left"><figure><img src="/files/HkhGaDAdT8jZNbp7tejn" alt="" width="375"><figcaption></figcaption></figure></div>

<table><thead><tr><th width="147">参数</th><th>描述</th></tr></thead><tbody><tr><td>允许无 Referer</td><td>该规则允许客户端在请求标头中不包含 UA 字段。</td></tr><tr><td>允许空 Referer</td><td>该规则允许客户端在标头中使用空值请求 UA。</td></tr><tr><td>允许列表 &#x26; 阻止列表</td><td><ul><li>允许列表<br>指定重定向 URL。如果请求中的 Referer 信息与白名单不匹配，在请求被阻止后不会返回 HTTP 403 状态码，而是返回 HTTP 302 状态码和 Location 标头。此参数是 Location 标头的值，以 <code>http://</code> 或 <code>https://</code> 开头，例如 <code>http://www.example.com</code>。</li><li>阻止列表<br>指定重定向 URL。如果请求中的 Referer 信息与黑名单匹配，在请求被阻止后不会返回 HTTP 403 状态码，而是返回 HTTP 302 状态码和 Location 标头。此参数是 Location 标头的值，以 <code>http://</code> 或 <code>https://</code> 开头，例如 <code>http://www.example.com</code>。</li></ul></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/content-delivery-network/domain-management/access-control/referer-restrictions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
