配合面板里的计划任务实现Cloudflare缓存删除
#!/bin/bash
# Cloudflare API Key and Zone ID
CF_ZONE_ID="Cloudflare 区域 ID"
AUTHORIZATION="Bearer Cloudflare API 密钥"
# Nginx Cache Folder
NGINX_CACHE_FOLDER="NGINX缓存位置"
# Purge Cloudflare Cache
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/purge_cache" \
-H "Authorization: $AUTHORIZATION" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
# Purge Nginx Cache
rm -rf $NGINX_CACHE_FOLDER/*
echo "路径:$NGINX_CACHE_FOLDER"
echo "Nginx缓存删除成功"
Cloudflare API 密钥:API 令牌 | Cloudflare
Cloudflare 区域 ID:Cloudflare 站点设置里的概述页右下角