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

Get a site's backup-file rule

Answers whether Corefinity blocks requests for database dumps left in the web root (a request for a .sql or .sql.gz file answers 404), whether the site carries the rule yet, and the file types it covers.

GET/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.

Returns

200 The rule's state.

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.

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.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "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
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT