corestack_ nginx_ rules_ copy
Copy nginx rules from another environment.
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_: 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
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
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.
nowwindowtonightRequired (true) when the target is the production environment.
Preview the copy: the content, the rewrites, a diff per hook and diagnostics; nothing is saved.
Another environment of the same site to copy from. At least 1.
The hooks to copy (default all). Up to 5 items.
serverheadersphphttppath_appsWhy, shown in the history (default "Copied from {source}"). Up to 200 characters.
The target environment row. At least 1.
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
{
"name": "corestack_nginx_rules_copy",
"arguments": {
"site_id": 4212,
"from_site_id": 4211,
"dry_run": true
}
}If it is refused
| Reason | What to do |
|---|---|
confirm | The target is production and confirm_production was not true. |
stale | The rules changed since version was read; read them again with corestack_nginx_rules_get. |
nginx_invalid | The 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_failed | Nginx -t failed on the environment's nginx; details.diagnostics. |
hook_unavailable | A hook (or a rule) needs the one-time runtime update, which cannot be turned on for this environment yet. |
nginx_rules_locked | Corefinity staff hold this environment's nginx rules. |
busy | Another change runs on the environment; retry when it ends. |
change_pending | A change is queued for tonight. |
batch_window | Adopting now is not possible outside the environment's window; send apply: tonight. |
migration_halted | The night's migration is halted; send apply: tonight. |
apm_provenance_unreadable | image_volume_unsupported, legacy_module_unmapped: the runtime update cannot be turned on until Corefinity checks the environment (contact support). |
too_large | A hook is over its size limit. |
managed_elsewhere | Another 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_arguments | The 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_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The 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_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something 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.