> For the complete documentation index, see [llms.txt](https://www.axisnow.io/zh/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.axisnow.io/zh/docs/multi-edge/services/edge-providers/testing.md). Agents can also search and read this documentation through its [MCP server](https://www.axisnow.io/zh/docs/~gitbook/mcp).

# 测试与验证

切换 DNS 之前用 curl 验证每一家 CDN 已能正常服务域名，切换后确认请求由哪一家 CDN 响应

边缘部署完成后、业务域名切换到服务 CNAME（Service CNAME）之前，可以先确认这家边缘已经能正确服务您的域名，不影响线上访客；切换之后，可以随时确认某个请求实际由哪一家边缘处理。

## 切换 DNS 前测试一家边缘 <a href="#test-before-dns-switch" id="test-before-dns-switch"></a>

边缘部署完成时，弹窗给出 **测试边缘提供商** 命令，把请求直接发到这家边缘的 CNAME，Host、SNI 和证书校验仍按业务域名进行，不需要修改本机 hosts 或公网 DNS：

```
curl -sS -o /dev/null --noproxy '*' \
  -w 'HTTP %{http_code}  via %{remote_ip}\n' \
  --connect-to '<域名>:443:<边缘 CNAME>:443' \
  'https://<域名>/'
```

关掉弹窗后也可以自己拼这条命令，边缘 CNAME 在 **边缘提供商** 标签页的 **CNAME** 列；仅调度（Steer）方式加入的边缘填它的接入地址即可。

<figure><img src="https://3062891322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKDgGNU6JXG7cqYCk2aCz%2Fuploads%2Fgit-blob-a77ebda48bf04afddd9bf47795f370f31e0c1468%2Ftesting-01.png?alt=media" alt="测试边缘提供商：用 curl 的 --connect-to 直连某一家边缘验证域名"><figcaption></figcaption></figure>

结果怎么读：

* `HTTP 200`：这家边缘已接受该域名并能正常回源
* `HTTP 5xx`：边缘已接受该域名，问题在源站或回源协议，见[源站](https://www.axisnow.io/zh/docs/multi-edge/services/origins.md)
* TLS 握手失败、证书不匹配：域名还没有在这家边缘上生效，或证书尚未同步到位，见[证书](https://www.axisnow.io/zh/docs/multi-edge/certificates.md)
* `Could not resolve host`：边缘 CNAME 的 DNS 解析还未生效，部署刚完成时等几分钟再试

## 在浏览器中测试 <a href="#test-in-browser" id="test-in-browser"></a>

想看到完整页面而不只是状态码，把域名在本机临时指向这家边缘：

1. 解析边缘 CNAME 得到 IP：`dig +short <边缘 CNAME>`，返回多个时任取一个。
2. 在 hosts 文件中加一行 `<IP> <域名>`。macOS / Linux 是 `/etc/hosts`，Windows 是 `C:\Windows\System32\drivers\etc\hosts`，都需要管理员权限。
3. 用浏览器访问站点，此时所有请求都走这家边缘。
4. 测完删掉这一行，否则本机会一直绕过 AxisNow 的调度。

## 确认由哪一家边缘服务 <a href="#check-serving-edge" id="check-serving-edge"></a>

以配置同步（Provision）方式加入的边缘，响应里都带有 `x-axisnow` 头，值标明处理这个请求的边缘。您可以使用如下命令行查看：

```
curl -sS --head --noproxy '*' 'https://demo.axisnow.io/'
```

<figure><img src="https://3062891322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKDgGNU6JXG7cqYCk2aCz%2Fuploads%2Fgit-blob-9ad08dd62f5937a83e716ba50cbe34e1d5b633c4%2Ftesting-02.png?alt=media" alt="curl 响应头中的 x-axisnow 标明由哪一家边缘服务"><figcaption></figcaption></figure>

浏览器里打开开发者工具（F12）→ **Network**，刷新页面，点开域名那条请求，在 **Response Headers** 中找 `x-axisnow`。

<figure><img src="https://3062891322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKDgGNU6JXG7cqYCk2aCz%2Fuploads%2Fgit-blob-d612debf32991afcd3f90ac50ed3b17a8436b347%2Ftesting-03.png?alt=media" alt="浏览器开发者工具 Response Headers 中的 x-axisnow 响应头"><figcaption></figcaption></figure>

Steer 方式加入的边缘不由 AxisNow 同步配置，没有这个头，可以用厂商自己的响应头判断，例如 Cloudflare 的 `cf-ray`、CloudFront 的 `x-amz-cf-id`。

## 验证区域规则 <a href="#verify-regional-rules" id="verify-regional-rules"></a>

按 Geo 或 ISP 分流的路由规则，只有从对应地区发出的请求才能验证。最直接的办法是看 **流量调度** 标签页：每条规则的 **调度目标** 列显示它当前的目的地，可用性和性能数据来自各地区的拨测点，不需要自己动手。要亲自确认，从该地区的机器或通过 VPN 访问站点，`x-axisnow` 的值应与那条规则的 **调度目标** 一致。路由规则的说明见[流量调度](https://www.axisnow.io/zh/docs/multi-edge/services/routing.md)。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.axisnow.io/zh/docs/multi-edge/services/edge-providers/testing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
