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

**nginx rules.** Read an environment row's custom nginx rules: the four hooks (server, headers, php, http) with whether each is available yet, the live status and the last error, the verify paths, the limits, the policy version, the read-only Corefinity rules and any staff lock. Every change needs the version this answers. Scope: read.

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

## When to use it

Read an environment row's custom nginx rules: the four hooks (server, headers, php, http) with whether each is available yet, the live status and the last error, the verify paths, the limits, the policy version, the read-only Corefinity rules and any staff lock. Every change needs the version this answers.

`hooks.<hook>.content` is the editor text (without the file's two banner lines); a hook that is not available yet carries `available_after` (`not_scheduled`, `scheduled` with its date, or `in_progress`). `status.state` is `never`, `live`, `applying`, `pending_verify`, `rejected`, `rolled_back` or `verify_failed`, with `status.error` (`hook`, file `line`, `column`, `code`, `message`) for the last rejection. `drift` is set when the repository's custom files differ from the saved rules (a change made outside the Control Panel): answer it with corestack_nginx_rules_drift_resolve (use the repository's rules, or keep the Control Panel's) with this `version`, or save again with corestack_nginx_rules_update. `adoption` says whether the one-time runtime update can be turned on now (`can_adopt_now`, `adopt_now_refusal`).

## Inputs

- `site_id` (integer, ≥ 1, required): The environment row.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "include_rendered": {
      "description": "Also answer path_apps.rendered.",
      "type": "boolean"
    },
    "site_id": {
      "description": "The environment row.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_nginx_rules_get",
  "arguments": {
    "site_id": 4211
  }
}
```

## Path apps

The answer also carries `path_apps`: `available` (false while this environment's runtime cannot serve path apps yet; saving a changed list is then refused with `path_apps_unavailable`), `items` (the environment's path apps and gates, the whole list that corestack_nginx_rules_update takes back), `presets` (each `{key, title, description, type, record}`: the fields a preset pre-fills), `hosts` (the hosts a record may name), `primary_host` (the production host a gate on `/` may not cover), `proxy_available` (whether this environment's runtime takes the `proxy` type; a proxy is refused with `path_app_proxy_unavailable` otherwise) and `rate_default` (`{per_second, burst}`: the limit the Control Panel starts a new path app with).

A path app serves part of the site from a folder of its own: `php-app` runs only the PHP files it lists (every other PHP file under its prefix answers 404) and serves the listed static file types, `static` serves only the listed types, `deny` answers 404 under its prefix, `proxy` forwards its prefix to another website over https. Any of php-app, static and proxy may carry a `rate` limit per visitor address (429 beyond it). A gate limits a prefix of the platform's own handling to an address list, hosts and methods. Addresses on the environment's firewall web list, and the Corefinity office, always skip a path app's password and always pass its gates and address lists. PHP from a path app is never cached.

### Inputs while path apps are on

- `include_rendered` (boolean): Also answer path_apps.rendered: the nginx the saved path apps become (default false). `front` and `back` for everyone who can see the environment, `http` for Corefinity staff.

### Example

```json
{
  "name": "corestack_nginx_rules_get",
  "arguments": {
    "site_id": 4211,
    "include_rendered": true
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_nginx_rules_get with site_id 4211. (nginx rules.) Tell me what it returned.
```

## The same task elsewhere

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