Origin Rewrite Rule
It is used to ensure that requests made to origin redirect some directories or files to different directories and files.
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
|
rewrite_origin_settings | This feature enables requests with specific file paths to be rewritten to target file paths. | Array | Yes |
rewrite_origin_settings.match_mode | Determines the matching mode. It takes “full_path”, “wildcard”, “all_files”, “path” values. | String | Yes |
rewrite_origin_settings.origin_uri | The path of the original file to be rewritten. If match_mode is “all_files”, origin_uri is not required. | String | Yes |
rewrite_origin_settings.target_uri | The path of the target file to be written. | String | Yes |
rewrite_origin_settings.priority | The priority of the setting. | String | Yes |
Payload
{
"resource_uuid": "****-****-****-****",
"rewrite_origin_settings": [
{
"match_mode": "full_path",
"origin_uri": "/test/1.jpg",
"target_uri": "/test/2.jpg",
"priority": 50
},
{
"match_mode": "wildcard",
"origin_uri": "/test.*",
"target_uri": "/test.mp4",
"priority": 10
},
{
"match_mode": "all_files",
"target_uri": "/assets",
"priority": 5
},
{
"match_mode": "path",
"origin_uri": "/test2",
"target_uri": "/test",
"priority": 15
}
]
}