create_redirection_host
Create HTTP redirects in Nginx Proxy Manager by specifying source domains, target domain, and redirect codes to manage web traffic routing.
Instructions
Create a new redirection host (HTTP redirect)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain_names | Yes | List of domain names | |
| forward_scheme | No | auto | |
| forward_http_code | Yes | HTTP redirect code (301, 302, etc.) | |
| forward_domain_name | Yes | Domain to redirect to | |
| preserve_path | No | ||
| certificate_id | No | ||
| ssl_forced | No | ||
| block_exploits | No | ||
| advanced_config | No |
Implementation Reference
- src/npm_mcp/client.py:247-252 (handler)Actual implementation of the create_redirection_host tool in the NPMClient class.
async def create_redirection_host(self, host: RedirectionHost) -> RedirectionHost: response = await self._request( "POST", "/api/nginx/redirection-hosts", json=host.model_dump(exclude_none=True, exclude={"id", "created_on", "modified_on"}), ) return RedirectionHost(**response.json()) - src/npm_mcp/server.py:390-391 (handler)Handler in server.py that routes the 'create_redirection_host' MCP tool call to the NPMClient.
elif name == "create_redirection_host": return _model_response(await npm_client.create_redirection_host(RedirectionHost(**arguments))) - src/npm_mcp/server.py:82-100 (registration)Registration and schema definition of the 'create_redirection_host' tool.
Tool( name="create_redirection_host", description="Create a new redirection host (HTTP redirect)", inputSchema={ "type": "object", "properties": { "domain_names": {"type": "array", "items": {"type": "string"}, "description": "List of domain names"}, "forward_scheme": {"type": "string", "enum": ["auto", "http", "https"], "default": "auto"}, "forward_http_code": {"type": "integer", "description": "HTTP redirect code (301, 302, etc.)", "enum": [300, 301, 302, 303, 304, 305, 307, 308]}, "forward_domain_name": {"type": "string", "description": "Domain to redirect to"}, "preserve_path": {"type": "boolean", "default": False}, "certificate_id": {"type": "integer"}, "ssl_forced": {"type": "boolean", "default": False}, "block_exploits": {"type": "boolean", "default": True}, "advanced_config": {"type": "string", "default": ""}, }, "required": ["domain_names", "forward_http_code", "forward_domain_name"], }, ),