---
title: "corestack_nginx_rules_drift_resolve"
url: https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_drift_resolve
type: tool
last_updated: 2026-11-13
feature: nginx-rules
related:
  - https://docs.corefinity.com/api/reference/site-settings/resolve-site-nginx-drift.md
  - https://docs.corefinity.com/guides/sites/site-settings/web-server-rules.md
---
# corestack_nginx_rules_drift_resolve

**Answer an nginx rules drift.** Answer a drift on an environment row (corestack_nginx_rules_get shows `drift` when the nginx rules in the environment's configuration repository were changed outside the Control Panel): `committed` makes the repository's rules the saved rules, checked like a save; `panel` keeps the Control Panel's rules and stops showing this drift. Needs the version corestack_nginx_rules_get answered. Scope: write.

- Scope: `write`
- Runs as a task: no

## When to use it

Answer a drift on an environment row. `corestack_nginx_rules_get` shows `drift` when the nginx rules in the environment's configuration repository were changed outside the Control Panel (for example by a hand edit): `drift.hooks` names the hooks that differ, `drift.diff` shows how, and `drift.committed_valid` says whether the repository's version passes the platform's checks. Ask the person which answer they want, then call this with the `version` that read answered. It is the Nginx tab's **Use the committed version** and **Keep the Control Panel's**.

- `committed`: the repository's rules become the saved rules, as a new revision authored by the person and this token. It is unverified (`pending_verify`) until the platform checks it like a save; a failed check puts the last verified rules back automatically. Nothing is committed: the repository already holds the rules. Follow it with `corestack_nginx_rules_get` (`status.state`).
- `panel`: the Control Panel's rules stay the saved rules and nothing is written. This drift stops being shown, and the next save (`corestack_nginx_rules_update`) writes the Control Panel's rules again. A later change outside the Control Panel shows as a new drift.

Saving again with `corestack_nginx_rules_update` also replaces a drift with the saved rules. The answer is `{action, revision, note}`: `revision` (`id`, `number`, `status`) for `committed`, null for `panel`.

## Inputs

- `site_id` (integer, ≥ 1, required): The environment row.
- `version` (integer, ≥ 0, required): The version from corestack_nginx_rules_get.
- `action` (string, `committed` or `panel`, required): committed: use the rules the repository holds (a new revision, checked like a save). panel: keep the Control Panel's rules; nothing is written.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "action": {
      "description": "committed: use the rules the repository holds (a new revision, checked like a save). panel: keep the Control Panel's rules; nothing is written.",
      "enum": [
        "committed",
        "panel"
      ],
      "type": "string"
    },
    "site_id": {
      "description": "The environment row.",
      "minimum": 1,
      "type": "integer"
    },
    "version": {
      "description": "The version from corestack_nginx_rules_get.",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "version",
    "action"
  ],
  "type": "object"
}
```

## Refusals

- `stale`: the rules changed since `version` was read; read them again with corestack_nginx_rules_get.
- `no_drift`: there is no change made outside the Control Panel to answer (already answered, or never there).
- `nginx_rules_locked`: Corefinity staff hold this environment's nginx rules.
- `busy`: another change runs on the environment; retry when it ends. `committed` only.
- `change_pending`: a change is queued for tonight, or the last move of Corefinity's rules is still being checked. `committed` only.
- `inventory_behind`: the repository changed again after the drift was read; read the rules again, review the new drift, then answer. `committed` only.
- `files_missing`: the repository lacks a hook file this environment carries, so the committed version is incomplete; answer `panel` (the next save writes the file again). `committed` only.
- `nginx_invalid`: the repository's rules break the platform's policy; `details.diagnostics` lists each error with hook, line and code (`banner_changed`: a hook's first lines were edited). Answer `panel` or save corrected rules. `committed` only.
- `upstream_unavailable`: the environment's configuration repository cannot be read right now; try again in a few minutes. `committed` only.
- `managed_elsewhere` (message: "This site is managed by another control panel"): 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.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited` (20 answers a minute per environment, shared with the Nginx tab and the API), `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_nginx_rules_drift_resolve",
  "arguments": {
    "site_id": 4211,
    "version": 7,
    "action": "committed"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_nginx_rules_drift_resolve with site_id 4211, version 7, action committed. (Answer an nginx rules drift.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/nginx-rules/drift](https://docs.corefinity.com/api/reference/site-settings/resolve-site-nginx-drift.md)
- Guide: [Web server rules](https://docs.corefinity.com/guides/sites/site-settings/web-server-rules.md)
