CorefinityCorefinityDocs
Open the Control PanelControl Panel
Web server rules · 5 of 19

Update a site's backup-file rule

Switches the rule on or off. The change applies at once, so it cannot be scheduled: follow the operation in the answer. Sending the state the site already has answers 200 with operation: null.

PUT/api/corestack/sites/{site}/nginx-rules/backup-guard

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Body

applystring

Only now, the default. The change always applies at once.

now
enabledbooleanRequired

True to block backup files, false to stop.

Returns

200 The site already has that state. Nothing was started and operation is null.

201 The change was saved and started. Follow operation.

Fields of the 200 answer
backup_guardobjectRequired

Corefinity's backup-file rule on one site.

Fields
appliedbooleanRequired

Whether the site carries the rule now.

attention_extensionsarray of stringsRequired

File endings that often hold backups and that the rule does not block.

availablebooleanRequired

Whether the rule is offered for the site. False while it is not, and switching it on is refused.

enabledbooleanRequired

Whether the rule is wanted. On unless somebody switched it off.

extensionsarray of stringsRequired

The file endings the rule blocks.

linesarray of stringsRequired

The rule as Nginx reads it, for display.

pendingbooleanRequired

Whether a change to the rule is still running.

platform_enforcedbooleanRequired

True when the site's platform always blocks these files itself, so the rule cannot be switched off.

switched_off_atstring or nullRequired

When the rule was switched off. Null while it is on. Format: date-time.

uncertainbooleanRequired

True when the last change was saved but not confirmed, so whether the site carries the rule is not known. It is applied again within a few minutes.

operationobject or any or nullRequired

The change to follow. Null when nothing was started.

Fields of the 201 answer
backup_guardobjectRequired

Corefinity's backup-file rule on one site.

Fields
appliedbooleanRequired

Whether the site carries the rule now.

attention_extensionsarray of stringsRequired

File endings that often hold backups and that the rule does not block.

availablebooleanRequired

Whether the rule is offered for the site. False while it is not, and switching it on is refused.

enabledbooleanRequired

Whether the rule is wanted. On unless somebody switched it off.

extensionsarray of stringsRequired

The file endings the rule blocks.

linesarray of stringsRequired

The rule as Nginx reads it, for display.

pendingbooleanRequired

Whether a change to the rule is still running.

platform_enforcedbooleanRequired

True when the site's platform always blocks these files itself, so the rule cannot be switched off.

switched_off_atstring or nullRequired

When the rule was switched off. Null while it is on. Format: date-time.

uncertainbooleanRequired

True when the last change was saved but not confirmed, so whether the site carries the rule is not known. It is applied again within a few minutes.

operationobject or any or nullRequired

The change to follow. Null when nothing was started.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409busyAnother operation is running on the site. Wait for it to finish.
409conflictThe action conflicts with the object's present state. Read the message.
409files_missingThe files the Control Panel manages for this are missing or not ready yet. Read the message: try again in a few minutes, keep the Control Panel's version, or contact support.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409restore_runningA restore is running on the site. Wait for it to finish, then try again.
409wrong_platformThis is not available for the site's platform. Use it on a site of the platform it is for.
422apply_not_supportedThis change applies at once, so it cannot be scheduled.
422invalidFix the field named in field; errors says why.
422nginx_rules_lockedCorefinity has locked this environment's nginx rules. Contact support to change them.
422not_availableThe tool does not apply to this object.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'
{
  "backup_guard": {
    "applied": true,
    "attention_extensions": [
      "zip",
      "tar.gz",
      "tgz"
    ],
    "available": true,
    "enabled": true,
    "extensions": [
      "sql",
      "sql.gz"
    ],
    "lines": [
      "set $cf_backup_guard_body \"\";",
      "if ($uri ~* \"\\.(?:sql|sql\\.gz)$\") { return 404 $cf_backup_guard_body; }"
    ],
    "pending": false,
    "platform_enforced": false,
    "switched_off_at": null,
    "uncertain": false
  },
  "operation": null
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT