EdgeScript enables script-based programmable configurations for Alibaba Cloud Content Delivery Network (CDN). EdgeScript allows you to efficiently customize your Alibaba Cloud CDN service based on your business requirements. In the Alibaba Cloud CDN console, you can create scripts based on the EdgeScript coding standard, and publish the scripts to the production environment to customize your Alibaba Cloud CDN service. This topic describes how to create a script in the Alibaba Cloud CDN console.
EdgeScript is a type of script that is designed for Alibaba Cloud CDN. EdgeScript supports complex scripts with simple syntax, and allows you to efficiently customize your Alibaba Cloud CDN service. You can use EdgeScript to build a custom business system based on Alibaba Cloud CDN. Custom scripts can take effect among all CDN nodes within several seconds. Agile and fast service releases and upgrades allow you to develop services in a more efficient way.
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
- Click EdgeScript.
- Create a script in the staging environment.
- On the Staging Environment page, click Add Rule.
- In the pane that appears, set the parameters.
- Click Publish to Staging Environment.
- Test the script in the staging environment.The following figure shows the IP address of the host that is used to test scripts in the staging environment. Use the IP address of the test host that appears in the Alibaba Cloud CDN console.
On your machine, find the hosts file under the path C:\Windows\System32\drivers\etc. Add the IP address of the test host to the hosts file.
- After the test is completed, click Publish All Rules to Production Environment to publish the script to the production environment.Notice After you publish a script from the staging environment to the production environment, the script in the staging environment is automatically cleared.
- To modify scripts that you have already published to the production environment, you
must copy the scripts from the production environment to the staging environment,
and then modify the scripts. You can click Copy Rules from Production Environment to copy scripts from the production environment to the staging environment.After you copy a script from the production environment to the staging environment, you can modify the copied script in the staging environment.