update_redirection_host
Modify an existing redirection host configuration in Nginx Proxy Manager to change domain routing, SSL settings, or forwarding behavior.
Instructions
Update an existing redirection host
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host_id | Yes | The ID of the redirection host to update | |
| domain_names | No | ||
| forward_scheme | No | ||
| forward_http_code | No | ||
| forward_domain_name | No | ||
| preserve_path | No | ||
| certificate_id | No | ||
| ssl_forced | No | ||
| block_exploits | No | ||
| advanced_config | No |
Implementation Reference
- src/npm_mcp/client.py:254-260 (handler)The NPMClient method that performs the actual API request to update a redirection host.
async def update_redirection_host(self, host_id: int, host: RedirectionHost) -> RedirectionHost: host_id = _validate_int_id(host_id, "host_id") response = await self._request( "PUT", f"/api/nginx/redirection-hosts/{host_id}", json=host.model_dump(exclude_none=True, exclude={"id", "created_on", "modified_on", "owner_user_id"}), ) return RedirectionHost(**response.json()) - src/npm_mcp/server.py:392-398 (handler)The handler in the MCP server that processes the 'update_redirection_host' tool call. It fetches the current state, merges the updates, and calls the client method.
elif name == "update_redirection_host": args = dict(arguments) host_id = args.pop("host_id") current = await npm_client.get_redirection_host(host_id) updated_data = current.model_dump() updated_data.update(args) return _model_response(await npm_client.update_redirection_host(host_id, RedirectionHost(**updated_data))) - src/npm_mcp/server.py:101-120 (registration)The registration of the 'update_redirection_host' tool with its input schema.
Tool( name="update_redirection_host", description="Update an existing redirection host", inputSchema={ "type": "object", "properties": { "host_id": {"type": "integer", "description": "The ID of the redirection host to update"}, "domain_names": {"type": "array", "items": {"type": "string"}}, "forward_scheme": {"type": "string", "enum": ["auto", "http", "https"]}, "forward_http_code": {"type": "integer"}, "forward_domain_name": {"type": "string"}, "preserve_path": {"type": "boolean"}, "certificate_id": {"type": "integer"}, "ssl_forced": {"type": "boolean"}, "block_exploits": {"type": "boolean"}, "advanced_config": {"type": "string"}, }, "required": ["host_id"], }, ),