CorefinityCorefinityDocs
Open the Control PanelControl Panel
Web server rules · 7 of 14

corestack_nginx_rules_copy

Copy nginx rules from another environment.

Scope writeAsks you to confirmRuns as a taskNo secrets returned
On this page

When to use it

Copy the live nginx rules of another environment of the same site onto this environment row (promote staging to production on the production row, with confirm_production). The web root in the rules is rewritten for the target. dry_run previews the result without saving; otherwise the copy is checked, tested and saved like any change and needs the target's version from corestack_nginx_rules_get.

A dry run answers {state: dry_run, content, rewrites, diff, diagnostics, source_revision}: the copied hooks, each web-root rewrite (hook, from, to, count), a unified diff per hook (null where it does not change) and the diagnostics the save would give. A copy answers as corestack_nginx_rules_update. The pins of the token must cover both environments.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_nginx_rules_copy with site_id 4212, from_site_id 4211, dry_run true. (Copy nginx rules from another environment.) Tell me what it returned.

Inputs

applystring

Only when the copy adopts the runtime update on save: now or tonight. Default now. window: the row's next maintenance window (tonight is kept as its alias). Defaults to now.

nowwindowtonight
confirm_productionbooleanConfirmation

Required (true) when the target is the production environment.

dry_runboolean

Preview the copy: the content, the rewrites, a diff per hook and diagnostics; nothing is saved.

from_site_idintegerRequired

Another environment of the same site to copy from. At least 1.

hooksarray of strings

The hooks to copy (default all). Up to 5 items.

serverheadersphphttppath_apps
notestring

Why, shown in the history (default "Copied from {source}"). Up to 200 characters.

site_idintegerRequired

The target environment row. At least 1.

versioninteger

The target's version from corestack_nginx_rules_get (not needed for a dry run). At least 0.

Your assistant fills in a confirmation only after you agree.

Example call

tools/call
{
  "name": "corestack_nginx_rules_copy",
  "arguments": {
    "site_id": 4212,
    "from_site_id": 4211,
    "dry_run": true
  }
}

If it is refused

ReasonWhat to do
confirmThe target is production and confirm_production was not true.
staleThe rules changed since version was read; read them again with corestack_nginx_rules_get.
nginx_invalidThe policy refused the rules; details.diagnostics lists each error with hook, file line and column. When the rules need the environment's runtime update and the platform has no model for the revision it would move to, every hook answers runtime_model_missing naming that revision 'after this change': support moves the site to a supported revision.
nginx_test_failedNginx -t failed on the environment's nginx; details.diagnostics.
hook_unavailableA hook (or a rule) needs the one-time runtime update, which cannot be turned on for this environment yet.
nginx_rules_lockedCorefinity staff hold this environment's nginx rules.
busyAnother change runs on the environment; retry when it ends.
change_pendingA change is queued for tonight.
batch_windowAdopting now is not possible outside the environment's window; send apply: tonight.
migration_haltedThe night's migration is halted; send apply: tonight.
apm_provenance_unreadableimage_volume_unsupported, legacy_module_unmapped: the runtime update cannot be turned on until Corefinity checks the environment (contact support).
too_largeA hook is over its size limit.
managed_elsewhereAnother control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

Path apps

A copy also carries the source's path apps and gates: hooks may name path_apps beside the four hooks, and leaving hooks out copies all five. The source's list replaces the target's whole list. A record limited to hosts keeps the ones the target also has; one left with none is not copied (it never widens to all hosts), and the copy names it: warnings in the dry run, path_app_not_carried with the record, its prefix and the hosts dropped. The dry run's content.path_apps is the list the target would get and diff.path_apps its unified diff against the target's, written as YAML. A target whose runtime cannot serve path apps yet refuses path_apps_unavailable.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT