Skip to main content

CDN Resource - Create Page Rule

This setting is available in small, large and dynamic(aksela) resource types.

Method

URL

PUT

https://cloud.medianova.com/api/v1/cdn/{organization_uuid}/resource/{resource_uuid}

Parameters

Description

Type

Required

organization_uuid

The created organization in Medianova Cloud Panel unit ID value. Path parameter.

String

Yes

resource_uuid

The created resource in Medianova Cloud Panel unit ID value. Path parameter.

String

Yes

page_rule

This feature allows you to create customized page rules for a specific path.

Object

Yes

status_file_extension

The values of the status_file_extension must be any of the; “true”, “false”.

Boolean

Yes

page_rule.exact_match

The values of the exact_match must be any of the; “true”, “false”.

Boolen

No

page_rule.cache_type

The values of the status_file_extension must be any of the; “edge”, “origin”.

String

No

page_rule.custom_header

If status_custom_headers is true, custom headers is entered. If custom_header_status true, custom_header is required.

Object

No

page_rule.custom_header.key

 If status_custom_headers is true, custom headers.key is entered. If custom_header_status true, custom_header.key is required.

String

No

page_rule.custom_header.type

The values of the custom_headers_type must be any of the; “request_header”, “add_header”, “hide_header”. If custom_header_status true, custom_header. type is required.

String

No

page_rule.custom_header.value

If status_custom_headers is true, custom headers.value is entered. If custom_header_status true, custom_header.value is required.

String

No

page_rule.custom_header_status

The values of the status_custom_header must be any of the; “true”, “false”.

Boolean

Yes

page_rule.custom_header_used_type

The values of the page_rule.custom_header_used_type must be any of the; “default”, “custom”.

String

No

page_rule.edge_cache_expiry

Edge Cache Time cannot be greater than 1 month.

Integer

No

page_rule.edge_cache_unit

The values of the Edge cache unit must be any of the; “s”, “m”, “h”, “d”, “M”.

String

No

page_rule.file_extension

If status_file_extension is true, file_extension. is entered.

  • The file extension character length is maximum 255 and maximum 25 file extension.

String

Yes

page_rule.file_path

file_path must start with “/”.

  • The file path character length is maximum 255.

String

Yes

page_rule.geo_block

You can customize which countries can access your content by whitelist or blacklist.

Boolean

No

page_rule.status_hl_protection

The values of the page_rule.status_hl_protection must be any of the; “true”, “false”.

Boolean

No

page_rule.hl_protection_used_type

The values of the page_rule.hl_protection_used_type must be any of the; “default”, “custom”.

String

No

page_rule.hl_protection_domains

Enables hotlink protection which prevents other websites from directly linking to your content. When enabled, you can also set specific domains to be excluded from hotlink protection by adding them to whitelist.

Array, URL

No

page_rule.is_delete

The page rule contains deletion information.

Boolean

No

page_rule.security_header_details

Contains the security header parameters.

Object

No

page_rule.security_headers

The values of the security_headers must be any of the; “true”, “false”.

Boolean

No

page_rule.security_header_used_type

The values of the page_rule.security_header_used_type must be any of the; “default”, “custom”.

String

No

page_rule.security_headers.x_xss_ protection

The values of the security_headers.x_xss_protection must be any of the; “true”, “false”.

Boolean

No

page_rule.security_headers.http_st rict_transport_security

Must be enabled in order to use HSTS. The values of the security_headers. http_strict_transport_security must be any of the; “true”, “false”.

Boolean

No

page_rule.security_headers.x_fram e_options

The values of the security_headers.x_frame_option must be any of the; “true”, “false”.

Boolean

No

page_rule.security_headers.x_cont ent_type_options

The values of the security_headers.x_content_type_options must be any of the; “true”, “false”.

Boolean

No

page_rule.security_headers.max_ age

The values of the max_age must be any of the “in:1h,2h,3h,6h,12h,1d,2d,3d,1M,6M,1y”.

Integer

No

page_rule.security_headers.sub_d omains

The values of the security_headers.sub.domains must be any of the; “true”, “false”.

Boolean

No

page_rule.security_headers.preload

The values of the security_headers.preload must be any of the; “true”, “false”.

Boolean

No

page_rule.range_based_caching_used_type

The values of the page_rule.range_based_caching_used_type must be any of the; “default”, “custom”.

String

No

range_based_caching_value

The values of the range_based_caching_value must be any of the “in:512k, 1m, 2m, 3m, 4m, 5m, 6m, 7m, 8m, 9m, 10m”.

String

No

Payload

CODE
{
    "resource_uuid": "***-***-***-****",
    "status_file_extension": true,
    "page_rule": [
        {
            "rule_id": 17,
            "is_delete": false,
            "file_extension": [
                "png",
                "css"
            ],
            "file_path": "/test123",
            "cache_type": "edge",
            "edge_cache_expiry": 10,
            "edge_cache_unit": "d",
            "geo_block": true,
            "status_range_based_caching": true,
            "range_based_caching_used_type": "custom",
            "range_based_caching_value": "3m",
            "security_headers": true,
            "security_header_used_type": "default",
            "custom_header_status": true,
            "custom_header_used_type": "default",
            "status_qs": "on",
            "status_qs_cache_ignore": false,
            "qs_cache_ignore_param": [],
            "status_cqs": false,
            "cqs_args": [],
            "status_hl_protection": true,
            "hl_protection_used_type": "custom",
            "hl_protection_type": "whitelist",
            "hl_protection_domains": [
                "1.2.3.4"
            ],
            "include_blank_referer": true,
            "exact_match": false
        }
    ]
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.