小编Dan*_*pin的帖子

通过 Cloudflare API 转发 URL

我正在尝试使用 Cloudflare 的 API 创建页面规则以将 http 转发到 https。不幸的是,我不认为文档是 100% 清楚如何做到这一点。这是我当前传递给 POST 正文的 JSON 对象:

{
  "targets": [
    {
      "target": "url",
      "constraint": {
        "operator": "matches",
        "value": "http://exampletest.com/*"
      }
    }
],
  "actions": [{
    "id": "forwarding_url",
    "value": "https://exampletest.com/$1"
  }]
}
Run Code Online (Sandbox Code Playgroud)

这是我要回来的消息:

{
"success": false,
"errors": [
    {
        "code": 1004,
        "message": "Page Rule validation failed: See messages for details."
    }
],
"messages": [
    {
        "code": 1,
        "message": ".settings[0].url: This value should not be blank.",
        "type": null
    },
    {
        "code": 2,
        "message": ".settings[0].statusCode: This value …
Run Code Online (Sandbox Code Playgroud)

api cloudflare

4
推荐指数
1
解决办法
343
查看次数

标签 统计

api ×1

cloudflare ×1