网站启用CDN前,如何进行测试?

知识问答作者:U大使日期:2021-01-24点击:151

网站启用CDN云分发加速前,如何进行测试?

如果您购买了CDN服务,正式使用前希望在不修改域名解析的情况下进行测试,我们推荐您使用域名绑定host的方式。
步骤一. 获取CDN服务的边缘节点IP
在控制台上找到加速域名对应的CDN域名

ping 该CDN域名,获得边缘节点IP

步骤二. 绑定host
windows 环境下
在C:WindowsSystem32driversetc目录下打开hosts文件,按下图样式填写步骤1获得的边缘节点IP和加速域名,并保存。此处以1.1.1.1 和 www.utestcdn.cn 为例

# Copyright (c) 1993-2009 Microsoft Corp.## This is a sample HOSTS file used by Microsoft TCP/IP for Windows.## This file contains the mappings of IP addresses to host names. Each# entry should be kept on an individual line. The IP address should# be placed in the first column followed by the corresponding host name.# The IP address and the host name should be separated by at least one# space.## Additionally, comments (such as these) may be inserted on individual# lines or following the machine name denoted by a '#' symbol.## For example:##   102.54.94.97   rhino.acme.com     # source server#    38.25.63.10   x.acme.com       # x client host# localhost name resolution is handled within DNS itself.#    127.0.0.1    localhost#    ::1       localhost

1.1.1.1 www.utestcdn.cn
完成后,ping域名 www.utestcdn.cn,解析指向ip就是1.1.1.1了。
上述步骤完成后使用浏览器进行测试

下一篇       上一篇