内容分发网络 CDN-修改域名全量配置接口:请求示例

时间:2024-04-23 16:29:51

请求示例

PUT https://cdn.myhuaweicloud.com/v1.1/cdn/configuration/domains/www.example.com/configs

{
  "configs" : {
    "origin_request_header" : [ {
      "name" : "test-name",
      "value" : "test_value",
      "action" : "set"
    } ],
    "http_response_header" : [ {
      "name" : "test-name",
      "value" : "test_value",
      "action" : "set"
    } ],
    "url_auth" : {
      "status" : "off"
    },
    "compress" : {
      "status" : "off"
    },
    "force_redirect" : {
      "status" : "on",
      "type" : "http",
      "redirect_code" : 301
    },
    "origin_protocol" : "follow",
    "referer" : {
      "type" : "black",
      "value" : "192.168.0.0",
      "include_empty" : true
    },
    "ip_filter" : {
      "type" : "black",
      "value" : "192.168.0.0"
    },
    "origin_follow302_status" : "off",
    "cache_rules" : [ {
      "match_type" : "file_extension",
      "match_value" : ".zip",
      "ttl" : 0,
      "ttl_unit" : "h",
      "priority" : 10,
      "follow_origin" : "off",
      "url_parameter_type" : "del_params",
      "url_parameter_value" : "test_param"
    } ],
    "sources" : [ {
      "origin_addr" : "www.example.com",
      "origin_type" : "domain",
      "priority" : 70,
      "http_port" : 80,
      "https_port" : 443
    } ],
    "flexible_origin" : [ {
      "priority" : 1,
      "match_type" : "file_path",
      "match_pattern" : "/test",
      "back_sources" : [ {
        "sources_type" : "domain",
        "ip_or_domain" : "www.back.example.com"
      } ]
    } ],
    "slice_etag_status" : "off",
    "ipv6_accelerate" : 1,
    "origin_receive_timeout" : 30,
    "remote_auth" : {
      "remote_authentication" : "on",
      "remote_auth_rules" : {
        "auth_server" : "https://192.168.0.0",
        "request_method" : "GET",
        "file_type_setting" : "all",
        "reserve_args_setting" : "reserve_all_args",
        "reserve_headers_setting" : "reserve_specific_headers",
        "auth_success_status" : "200",
        "auth_failed_status" : "403",
        "response_status" : "403",
        "timeout" : 500,
        "timeout_action" : "pass",
        "reserve_headers" : "sf",
        "add_custom_args_rules" : [ {
          "type" : "nginx_preset_var",
          "key" : "http_host",
          "value" : "$http_host"
        } ],
        "add_custom_headers_rules" : [ {
          "type" : "nginx_preset_var",
          "key" : "http_host",
          "value" : "$http_host"
        } ]
      }
    },
    "websocket" : {
      "status" : "on",
      "timeout" : 60
    },
    "video_seek" : {
      "enable_video_seek" : true,
      "enable_flv_by_time_seek" : true,
      "start_parameter" : "start",
      "end_parameter" : "end"
    },
    "request_limit_rules" : [ {
      "status" : "on",
      "match_type" : "catalog",
      "match_value" : "/test",
      "type" : "size",
      "limit_rate_after" : 1024,
      "limit_rate_value" : 50,
      "priority" : 88
    } ],
    "sni" : {
      "status" : "on",
      "server_name" : "test.example.com"
    },
    "request_url_rewrite" : [ {
      "condition" : {
        "match_type" : "full_path",
        "match_value" : "/test/*.jpg",
        "priority" : 10
      },
      "redirect_status_code" : 301,
      "redirect_url" : "/test/index.html",
      "redirect_host" : "http://www.example.com",
      "execution_mode" : "redirect"
    } ],
    "browser_cache_rules" : [ {
      "condition" : {
        "match_type" : "full_path",
        "match_value" : "/test/*.jpg",
        "priority" : 10
      },
      "cache_type" : "ttl",
      "ttl" : 20,
      "ttl_unit" : "h"
    } ]
  }
}
support.huaweicloud.com/api-cdn/UpdateDomainFullConfig.html