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

Get the Nginx rules policy

Answers what Nginx rules may contain: the directives each hook takes, the ones that are refused and why, and the limits. Send site for the policy of one site, or platform for a platform in general. The answer carries an ETag; send it back in If-None-Match and an unchanged policy answers 304 with no body.

GET/api/corestack/nginx-rules/policy

Query parameters

siteinteger

The id of a site row: the policy for its platform and the hooks it can use. A site you cannot see answers 404. At least 1.

platformstring

A platform, when site is not sent.

laravelmagento2phpshopwareshopware5wordpress
If-None-Matchstring

The ETag of an earlier answer.

Returns

200 The policy. The lists are shortened here.

304 The policy has not changed since the ETag sent in If-None-Match. No body.

Fields of the 200 answer
directivesarray of objectsRequired

The directives that may be used.

Fields of each item
argsarray of strings

How many arguments it takes.

checksarray of strings
contextsarray of stringsRequired

Where in a hook it may stand.

docstring or null
hooksarray of stringsRequired
namestringRequired
prefixboolean
header_governedobject

Response headers the platform sets (fixed), frames (framing) or governs (governed).

Fields
fixedarray of stringsRequired
framingarray of stringsRequired
governedarray of stringsRequired
hooksarray of stringsRequired

The hooks the policy is for.

limitsobjectRequired

The limits the rules are held to.

Fields
buffers_total_maxintegerRequired
hook_file_bytesintegerRequired
keepaliveintegerRequired
lines_warnintegerRequired
location_nestingintegerRequired
map_entriesintegerRequired
max_linesintegerRequired
max_locationsintegerRequired
max_regexintegerRequired
size_capsobjectRequired

The largest value each buffer directive may take, in bytes.

verify_pathsintegerRequired
zone_total_bytesintegerRequired
path_appsobject

What path apps may contain. Present while path apps are on for your company.

platform_headersarray of objects
Fields of each item
namestring
valuestring
platformsarray of stringsRequired
policy_versionintegerRequired
rate_limit_presetsarray
refusedarray of objectsRequired

Directives that are refused, each with why.

Fields of each item
contextstring or null
hookstring or null
messagestringRequired
namestringRequired
reasonstringRequired
reserved_prefixesarray of strings

Name prefixes kept for the platform.

static_extensionsarray of strings

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.
422invalidFix the field named in field; errors says why.
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/nginx-rules/policy \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "directives": [
    {
      "args": [
        "2",
        "3"
      ],
      "checks": [
        "add_header"
      ],
      "contexts": [
        "headers",
        "location",
        "location_if",
        "php"
      ],
      "doc": null,
      "hooks": [
        "server",
        "headers",
        "php"
      ],
      "name": "add_header",
      "prefix": false
    }
  ],
  "header_governed": {
    "fixed": [
      "X-Content-Type-Options",
      "Referrer-Policy",
      "X-Frame-Options",
      "Strict-Transport-Security"
    ],
    "framing": [
      "Content-Type",
      "Content-Length",
      "Server"
    ],
    "governed": [
      "Cache-Control",
      "CDN-Cache-Control",
      "Cloudflare-CDN-Cache-Control",
      "Surrogate-Control",
      "X-Robots-Tag"
    ]
  },
  "hooks": [
    "server",
    "headers",
    "php",
    "http"
  ],
  "limits": {
    "buffers_total_max": 4194304,
    "hook_file_bytes": 65536,
    "keepalive": 32,
    "lines_warn": 1500,
    "location_nesting": 3,
    "map_entries": 1000,
    "max_lines": 2000,
    "max_locations": 200,
    "max_regex": 512,
    "size_caps": {
      "client_body_buffer_size": 1048576,
      "proxy_buffer_size": 262144,
      "proxy_busy_buffers_size": 1048576
    },
    "verify_paths": 5,
    "zone_total_bytes": 10485760
  },
  "platform_headers": [
    {
      "name": "X-Content-Type-Options",
      "value": "nosniff"
    }
  ],
  "platforms": [
    "wordpress"
  ],
  "policy_version": 6,
  "rate_limit_presets": [],
  "refused": [
    {
      "context": null,
      "hook": null,
      "message": "This module is not loaded by the platform's nginx.",
      "name": "*_by_lua*",
      "reason": "module_not_loaded"
    }
  ],
  "reserved_prefixes": [
    "cf_"
  ],
  "static_extensions": [
    "css",
    "js",
    "png",
    "jpg",
    "svg",
    "woff2",
    "pdf"
  ]
}
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