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

Get a site's Nginx rules

Answers the four hooks with their text, the version every change sends back, whether the rules are live, the verify paths, the limits and, when there is one, a change made outside the Control Panel (drift).

GET/api/corestack/sites/{site}/nginx-rules

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.

Query parameters

includestring

Send rendered to add path_apps.rendered, the Nginx text written for the path apps.

rendered

Returns

200 The site's Nginx rules.

Fields of the 200 answer
adoptedbooleanRequired

Whether the site's runtime has had the one-time update that the headers, php and http hooks need.

adoptionobjectRequired

Where that update stands, and whether a save can make it now or in the next window.

Fields
adopt_now_refusalany

Why a save cannot make it now. Null when it can.

adoptedbooleanRequired

Whether the site has taken the update.

can_adopt_nowbooleanRequired

Whether a save can make the update at once.

can_adopt_tonightbooleanRequired

Whether a save can queue the update for the next window.

in_progressbooleanRequired
planned_forstring or null
queued_forstring or null

The night the update waits for, when it is queued.

revisionany

The revision that made the update, once there is one.

backup_guardobject

Corefinity's backup-file rule. Present while the rule is offered for the site. 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.

corefinity_rulesobject or any or nullRequired

The rules Corefinity set up for the site, read only, with the blocks that can move into yours. Null when there are none to read.

driftobject or any or nullRequired

A change to the rules made outside the Control Panel, to answer. Null when there is none.

hooksobjectRequired

The four hooks.

Fields
headersobjectRequired
Fields
availablebooleanRequired

Whether the site can use this hook yet. headers, php and http need a one-time update of the site's runtime first.

available_afterobject

Present while the hook is not available: whether that update is not_scheduled, scheduled (with its date) or in_progress.

Fields
datestring or nullRequired
statestringRequired
not_scheduledscheduledin_progress
contentstring or nullRequired

The hook's text. Null when empty.

httpobjectRequired
Fields
availablebooleanRequired

Whether the site can use this hook yet. headers, php and http need a one-time update of the site's runtime first.

available_afterobject

Present while the hook is not available: whether that update is not_scheduled, scheduled (with its date) or in_progress.

Fields
datestring or nullRequired
statestringRequired
not_scheduledscheduledin_progress
contentstring or nullRequired

The hook's text. Null when empty.

phpobjectRequired
Fields
availablebooleanRequired

Whether the site can use this hook yet. headers, php and http need a one-time update of the site's runtime first.

available_afterobject

Present while the hook is not available: whether that update is not_scheduled, scheduled (with its date) or in_progress.

Fields
datestring or nullRequired
statestringRequired
not_scheduledscheduledin_progress
contentstring or nullRequired

The hook's text. Null when empty.

serverobjectRequired
Fields
availablebooleanRequired

Whether the site can use this hook yet. headers, php and http need a one-time update of the site's runtime first.

available_afterobject

Present while the hook is not available: whether that update is not_scheduled, scheduled (with its date) or in_progress.

Fields
datestring or nullRequired
statestringRequired
not_scheduledscheduledin_progress
contentstring or nullRequired

The hook's text. Null when empty.

limitsobjectRequired

The limits of a hook, and how much of each the saved hooks use.

Fields
max_bytesintegerRequired
max_linesintegerRequired
max_locationsintegerRequired
usedobjectRequired

Per hook; null for an empty hook.

Fields
headersobject or any or nullRequired
httpobject or any or nullRequired
phpobject or any or nullRequired
serverobject or any or nullRequired
warn_linesintegerRequired
lockedobject or any or nullRequired

Set when Corefinity manages the site's Nginx rules for you: changes are refused nginx_rules_locked. Null otherwise.

path_appsobject

The site's path apps and gates. Present while path apps are on for your company. A revision that changed them names path_apps in its hooks_changed and carries the list in its content, and restoring a revision restores its path apps too.

Fields
availablebooleanRequired

Whether the site can use path apps yet.

hostsarray of stringsRequired

The site's hostnames, which a record can be limited to.

itemsarray of objectsRequired
Fields of each item
hostsarray of strings

Some of the site's hostnames. Empty means all of them. Up to 16 items.

idstringRequired

a1, a2 and so on for a PHP app, static folder, other site or closed path; g1, g2 and so on for a gate. Keep it when you change a record. A new record may leave it out: it is given the next free number.

ipsarray of strings

Addresses or networks admitted, up to 64. A gate needs at least one. A network of /8 or wider, an address in a special-purpose range (the documentation ranges among them) and the platform's own ranges are refused.

labelstringRequired

A note. Empty when left out. Null is refused. Defaults to ``. Up to 80 characters.

limitsobject

For a PHP app.

Fields
body_size_mbinteger or null

The largest request body in MB, at most the site's upload size. Null, the default, leaves the site's own limit in force. Defaults to null. At least 1.

timeoutinteger

The PHP time limit in seconds. Defaults to 300. 30 to 300.

linksarray of objects

For a PHP app or static folder on a folder path: up to 4 folders of the path app that are served from the site's shared folder, such as its uploads. Left out of a saved record when there are none.

Fields of each item
pathstringRequired

A folder of the path app, relative to its path and ending in /, such as wp-content/uploads/. Two links cannot share a folder or lie inside one another, and PHP never runs under a link.

targetstringRequired

A folder below the site's shared folder that holds only public files, such as shared/wp-content/uploads on WordPress, with no trailing /. Refused: shared itself, a hidden folder (a name that starts with .), and a folder that is, is inside or contains one where the platform keeps code, logs or secrets, such as shared/logs or shared/vendor. The list differs per platform; on WordPress shared/wp-content/uploads and the folders below it are allowed although the rest of shared/wp-content is not.

methodsarray of strings

The request methods admitted. GET, HEAD and POST when left out.

GETHEADPOSTPUTPATCHDELETEOPTIONS
phpobject

For a PHP app, which needs it.

Fields
dir_indexarray of strings

Up to 8 folders whose index.php answers the folder, such as wp-admin/.

entriesarray of stringsRequired

1 to 32 PHP files that may run, relative to the path, such as wp-login.php or wp-admin/*.php. Every other PHP file under the path answers 404.

routerarray of strings

Up to 4 folders passed to the app's index.php, such as wp-json/, or / for the whole app.

prefixstringRequired

The path, such as /wp/. A PHP app or a gate can also name one file, and a gate / with hosts.

presetstring or nullRequired

The preset the record started from.

proxyobject

For another site on the path, which needs it.

Fields
connect_timeoutinteger

Defaults to 5. 1 to 30.

host_headerstring

target (the other site's own name), visitor (the name the visitor used) or another host name. Defaults to target.

pathstring

keep sends the path as it is; strip leaves your path out. Defaults to keep.

keepstrip
read_timeoutinteger

Defaults to 60. 5 to 300.

share_cookiesboolean

True sends your visitors' cookies and logins to the other site and lets it set cookies here. Defaults to false.

urlstringRequired

The other site: https://, a host name and optionally a port and a folder. Up to 255 characters.

rateobject or null

A rate limit per visitor, for a PHP app, a static folder or another site. Send both fields, or leave rate out (or send null) for no limit. Left out of a saved record that has none.

Fields
burstintegerRequired

0 to 1000.

per_secondintegerRequired

1 to 1000.

rootstring

For a PHP app or static folder: htdocs or shared, optionally with sub-folders.

staticobject

For a PHP app or static folder.

Fields
typesarray of strings

Lower-case file extensions served from disk, up to 32. The policy's default list when left out. A static folder serves at least one.

typestringRequired

A PHP app, a static folder, another site shown on the path (proxy), a closed path (deny) or a gate that admits only listed addresses.

php-appstaticproxydenygate
presetsarray of objectsRequired

Ready-made records for the site's platform.

primary_hoststring or nullRequired
proxy_availablebooleanRequired

Whether the site can show another site on a path yet.

rate_defaultobjectRequired

The rate limit the editor fills in on a new record. The API never adds one for you.

Fields
burstinteger
per_secondinteger
renderedobject or any or null

With include=rendered: the Nginx text written for the path apps. Null when there are none.

platformstringRequired
policy_versionintegerRequired
revisionobject or any or nullRequired

The saved revision. Null before the first save.

site_idintegerRequired

At least 1.

statusobjectRequired

Whether the saved rules are live.

Fields
applied_revision_idinteger or nullRequired

The revision that is live.

errorobject or any or nullRequired

Why the last change failed. Null otherwise.

operation_idinteger or nullRequired

The change that is running, to follow.

pending_reasonstring or nullRequired
revertobject or any or nullRequired

The automatic return to the rules before a failed change: running or failed. Null otherwise.

revision_idinteger or nullRequired
statestringRequired

never before the first save, applying while a change runs, live, pending_verify, or how the last change ended.

neverapplyinglivepending_verifyrejectedverify_failedrolled_back
verify_pathsarray of objectsRequired
Fields of each item
expectstringRequired

The answer expected: an exact status such as 403, a class such as 2xx, or <500. Defaults to <500.

pathstringRequired

A path on the site, starting with /.

versionintegerRequired

Send it back with every change. It moves each time the rules or the verify paths change.

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 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "adopted": false,
  "adoption": {
    "adopt_now_refusal": null,
    "adopted": false,
    "can_adopt_now": false,
    "can_adopt_tonight": false,
    "in_progress": false,
    "planned_for": null,
    "queued_for": null,
    "revision": null
  },
  "corefinity_rules": null,
  "drift": null,
  "hooks": {
    "headers": {
      "available": false,
      "available_after": {
        "date": null,
        "state": "not_scheduled"
      },
      "content": null
    },
    "http": {
      "available": false,
      "available_after": {
        "date": null,
        "state": "not_scheduled"
      },
      "content": null
    },
    "php": {
      "available": false,
      "available_after": {
        "date": null,
        "state": "not_scheduled"
      },
      "content": null
    },
    "server": {
      "available": true,
      "content": "location = /older {\n    return 410;\n}\n"
    }
  },
  "limits": {
    "max_bytes": 65536,
    "max_lines": 2000,
    "max_locations": 200,
    "used": {
      "headers": null,
      "http": null,
      "php": null,
      "server": {
        "bytes": 161,
        "lines": 3,
        "locations": 1
      }
    },
    "warn_lines": 1500
  },
  "locked": null,
  "platform": "wordpress",
  "policy_version": 6,
  "revision": {
    "author": {
      "client": null,
      "kind": "user",
      "name": "Eleanor Finch"
    },
    "created_at": "2026-11-02T15:41:09Z",
    "errors_since": null,
    "hooks_changed": [
      "server"
    ],
    "id": 317,
    "note": null,
    "number": 2,
    "origin": "editor",
    "status": "applied",
    "status_reason": null
  },
  "site_id": 1042,
  "status": {
    "applied_revision_id": 317,
    "error": null,
    "operation_id": null,
    "pending_reason": null,
    "revert": null,
    "revision_id": 317,
    "state": "live"
  },
  "verify_paths": [
    {
      "expect": "2xx",
      "path": "/checkout"
    }
  ],
  "version": 2
}
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