Skip to main content
Glama
VeryBigSad

Nginx Proxy Manager MCP

by VeryBigSad

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
NameRequiredDescriptionDefault
domain_namesYesList of domain names
forward_schemeNoauto
forward_http_codeYesHTTP redirect code (301, 302, etc.)
forward_domain_nameYesDomain to redirect to
preserve_pathNo
certificate_idNo
ssl_forcedNo
block_exploitsNo
advanced_configNo

Implementation Reference

  • 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())
  • 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)))
  • 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"],
        },
    ),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VeryBigSad/nginx-proxy-manager-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server