WhatsApp Trigger Webhook URL Generated as HTTP (not HTTPS)

Webhook Configuration Issue (HTTP vs. HTTPS)

The Problem:

  • My instance is running with HTTPS and is accessible via https://n8n.server.com

  • I am running the application behind an Nginx Reverse Proxy.

  • The Webhook URL generated by the “WhatsApp Trigger” node is still HTTP (not HTTPS), which prevents registration with Meta/Facebook, as they require HTTPS.

My Setup Details:

  • Workflow Application: n8n (Version: n8nio/n8n:latest via Docker)

  • Reverse Proxy: Nginx

Docker Environment Variables (n8n):

N8N_HOST=n8n.server.com.br
N8N_PORT=443
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.server.com
WEBHOOK_TUNNEL_URL=https://n8n.server.com

Nginx Configuration (443 server block):

Nginx

server {
    listen 443 ssl;
    server_name n8n.server.com;
    # ... SSL configuration (Let's Encrypt) ...

    location / {
        proxy_pass http://localhost:5678;
        
        # Crucial Proxy Headers
        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_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port 443;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
    }
}

Note: I have confirmed that the n8n container has been fully restarted after applying these environment variables.

Thank you in advance for your help!

You should also set N8N_PROXY_HOPS=1 since you are running behind a single reverse proxy. This helps n8n correctly interpret the forwarded headers and generate the right URLs.
N8N_PORT should be set to the internal port n8n listens on (usually 5678), not 443. The reverse proxy (Nginx) handles the HTTPS/443 part.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.