> For the complete documentation index, see [llms.txt](https://doc.user.cdnray.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.user.cdnray.net/ying-yong-fang-huo-qiang/hei-ming-dan-she-zhi.md).

# 黑名單設置

{% hint style="info" %}
根據設定的條件拒絕特定ip訪問特定域名
{% endhint %}

***

### **如何設置黑名單?**

* 站點管理 -> 站點設定 -> 應用防火牆 -> 黑名單設置 -> 新增URL

&#x20;   &#x20;

### **新增URL欄位說明**

* IP黑名單：支持單一ip或是網段，一行一筆
  * 單獨ip：
    * `1.1.1.1`
    * `1.1.1.1/32`  &#x20;
    * 網段：
      * `2.2.2.0/24`
    * 屏蔽來訪問的任何ip：
      * `0.0.0.0/0`<br>

  * URL：針對特定域名設定黑名單
    * 單一域名：
      * `www.example.com`
      * 單一域名(正則參數)：
        * `http?:\/\/www.example.com(.*)`
      * 不限定域名：

        * `/*`  或 `.*`  (通配符)

  * 方法：勾選要屏蔽的訪問方法

  * 防護模式：可選擇DENY、DROP、DROP+黑名單<br>

    <figure><img src="/files/CiBUTHXiDtbSwfrtj2ha" alt=""><figcaption></figcaption></figure>

### **配置範例1**：

* 拒絕 `3.3.3.3` 來訪問該站點下所有域名<br>

  <figure><img src="/files/BNcT4ua6op5simc9PWOi" alt=""><figcaption></figcaption></figure>

### **配置範例2**

* 限制域名僅能帶端口訪問，拒絕不帶端口的訪問
  * 允許訪問`www.example.com:1234` ，但不能訪問`www.example.com`
  * 白名單需要添加 `https://www.example.com:1234`
  * 黑名單添加 `https?:\/\/www.example.com`<br>
* 白名單設定

  <figure><img src="/files/0jLQMzB9dTNjhYWqw8Na" alt=""><figcaption></figcaption></figure>
* 黑名單設定<br>

  <figure><img src="/files/gxIGhMNQMFErRoa8ZdQu" alt=""><figcaption></figcaption></figure>

&#x20;   &#x20;

&#x20;  &#x20;


---

# 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:

```
GET https://doc.user.cdnray.net/ying-yong-fang-huo-qiang/hei-ming-dan-she-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
