nginx-proxy-manager/backend/schema/components/redirection-host-object.json
Tom Winnerl 2c56807eba feat(hosts): fresh nginx meta, server-owned meta keys, rollback of rejected changes
- all four host types write nginx_online, nginx_err, nginx_details and
  nginx_checked_at to meta on create, update and enable; these keys are
  owned by the server and stripped from incoming data
- an update nginx rejects at host level answers 400 and the previous row is
  restored (internalHost.updateAndConfigure), a rejected create is removed
- a new host that requests a certificate is checked with a dry run first, so
  a rejected host doesn't leave an unused certificate behind
- upstream host names are trimmed
- advanced configs (host and custom location) may not point access_log /
  error_log at files nginx reads as configuration, nor include generated
  host configs (lib/nginx-advanced.js, tokenizer in lib/nginx-tokenize.js)
- schema: meta keys of all host types, 400 examples

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:47:42 +01:00

135 lines
3 KiB
JSON

{
"type": "object",
"description": "Redirection Host object",
"required": [
"id",
"created_on",
"modified_on",
"owner_user_id",
"domain_names",
"forward_http_code",
"forward_scheme",
"forward_domain_name",
"preserve_path",
"certificate_id",
"ssl_forced",
"hsts_enabled",
"hsts_subdomains",
"http2_support",
"block_exploits",
"advanced_config",
"enabled",
"meta"
],
"additionalProperties": false,
"properties": {
"id": {
"$ref": "../common.json#/properties/id"
},
"created_on": {
"$ref": "../common.json#/properties/created_on"
},
"modified_on": {
"$ref": "../common.json#/properties/modified_on"
},
"owner_user_id": {
"$ref": "../common.json#/properties/user_id"
},
"domain_names": {
"$ref": "../common.json#/properties/domain_names"
},
"forward_http_code": {
"description": "Redirect HTTP Status Code",
"type": "integer",
"minimum": 300,
"maximum": 308,
"example": 302
},
"forward_scheme": {
"type": "string",
"enum": [
"auto",
"http",
"https"
],
"example": "http"
},
"forward_domain_name": {
"description": "Domain Name",
"type": "string",
"pattern": "^(?=[^\\s\\p{Cc};{}\"'#\\\\]+$)[^.*]+(?:\\.[^.*]+)*\\.?[^.]$",
"example": "jc21.com"
},
"preserve_path": {
"description": "Should the path be preserved",
"type": "boolean",
"example": true
},
"certificate_id": {
"$ref": "../common.json#/properties/certificate_id"
},
"ssl_forced": {
"$ref": "../common.json#/properties/ssl_forced"
},
"hsts_enabled": {
"$ref": "../common.json#/properties/hsts_enabled"
},
"hsts_subdomains": {
"$ref": "../common.json#/properties/hsts_subdomains"
},
"http2_support": {
"$ref": "../common.json#/properties/http2_support"
},
"block_exploits": {
"$ref": "../common.json#/properties/block_exploits"
},
"advanced_config": {
"type": "string",
"example": ""
},
"enabled": {
"$ref": "../common.json#/properties/enabled"
},
"meta": {
"type": "object",
"description": "Extra metadata. Keys starting with nginx_ are owned by the server and ignored on input",
"properties": {
"nginx_online": {
"type": "boolean",
"description": "Server-owned. False only when this host's config is not active in nginx"
},
"nginx_err": {
"type": ["string", "null"],
"description": "Server-owned. Human readable reason when nginx_online is false"
},
"nginx_details": {
"type": ["object", "null"],
"description": "Server-owned. Structured details of the failure (same shape as error.details)"
},
"nginx_checked_at": {
"type": "string",
"description": "Server-owned. ISO timestamp of the last nginx configuration"
}
},
"example": {
"nginx_online": true,
"nginx_err": null
}
},
"certificate": {
"oneOf": [
{
"type": "null",
"example": null
},
{
"$ref": "./certificate-object.json"
}
],
"example": null
},
"owner": {
"$ref": "./user-object.json"
}
}
}