Fixing “Unknown Webhook” and SSE Errors with n8n MCP Server Behind Nginx Proxy Manager 

 

 

 

🚨 The Problem

If you’re using n8n’s MCP Server Trigger behind Nginx Proxy Manager, you might run into errors like:

Received request for unknown webhook: The requested webhook "my-mcp/sse" is not registered.Could not connect to your MCP server

This happens when Server-Sent Events (SSE) aren’t properly forwarded through your reverse proxy setup.

🔍 Why This Happens

  • Nginx buffers the response (breaks SSE)
  • Compression like GZIP is turned on (incompatible with SSE)
  • Headers like Connection are misconfigured
  • Multiple webhook replicas aren’t correctly routed

✅ The Fix – Update Nginx Proxy Manager Configuration

Go to your Proxy Host in Nginx Proxy Manager and open the Advanced tab.

Paste this into the Custom Nginx Configuration box:

location /mcp-test/ {    proxy_http_version          1.1;    proxy_buffering             off;    gzip                        off;    chunked_transfer_encoding   off;    proxy_set_header            Connection '';    proxy_set_header            Host $host;    proxy_set_header            X-Real-IP $remote_addr;    proxy_set_header            X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header            X-Forwarded-Proto $scheme;    proxy_pass http://n8n:5678;}

Be sure to update the following:

  • /mcp-test/ → your actual MCP path prefix
  • http://n8n:5678 → the internal address of your n8n container

🧪 Test the Endpoint

Activate the workflow in n8n, then open this URL in your browser or use it in your MCP client:

https://agent.domain.com/mcp-test/my-mcp/sse

If it stays connected and doesn’t throw an error, you’re good to go!

💡 Extra Tips

  • Use location /mcp-test/ instead of /mcp* – Nginx doesn’t support wildcards like that
  • For multiple paths, use ~ ^/mcp.*?/ with regex
  • Route all /mcp* traffic to a single webhook container if using replicas