Typeform Trigger & Webhooks not working on self-hosted VPS due to CORS policy

Hello all. I am new to setting up a VPS and n8n. I’ve set up n8n on a Google Cloud VM running Debian 6.1 using Docker and can access the admin console via HTTPS. However, I’m facing issues with the Typeform Trigger and Webhooks.

I ran the following Docker run command:
sudo docker run -d --restart unless-stopped -it
–name n8n
-p 5678:5678
-e N8N_HOST=“n8n.openhousecenter.org
-e N8N_ALLOWED_ORIGINS=“*”
-e WEBHOOK_TUNNEL_URL=“https://{my_domain.tld}/”
-e N8N_PROTOCOL=https
-e N8N_SSL_KEY=/etc/letsencrypt/live/n8n.openhousecenter.org/privkey.pem
-e N8N_SSL_CER=/etc/letsencrypt/live/n8n.openhousecenter.org/fullchain.pem
-v ~/.n8n:/root/.n8n
n8nio/n8n

And my Nginx reverse proxy configuration file is as follows:
server {
listen 80;
server_name {my_domain.tld};

location / {
    add_header Access-Control-Allow-Origin *;
    proxy_pass http://localhost:5678;
    proxy_http_version 1.1;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Upgrade $http_upgrade;
}

listen 443 ssl; #managed by Certbot
ssl_certificate /etc/letsencrypt/live/{my_domain.tld}/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/{my_domain.tld}/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
if ($host = {my_domain.tld}) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name {my_domain.tld};
return 404; # managed by Certbot

}

The issue I am experiencing is that the Typeform Trigger is not properly receiving test events. There is some successful communication as providing my authentication token allows me to select my Typeform surveys from the dropdown menu but receiving forms I submit in real-time is not captured.

Additionally when I try to set up a Webhook and send a test event via the Typeform console, I get the following error via my web browser console:

Screenshot 2024-08-26 at 1.27.30 PM

I have no idea to resolve this issue. I have already tried adding directives to my Nginx reverse proxy configuration file to bypass the CORS policy. I also did the same with my Docker run command.

If anybody knows how to fix this issue or can provide guidance, that would be must appreciated. Thank you.

  • n8n version: 1.55.3
  • Database (default: SQLite): VM Volume
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker on VM
  • Operating system: Debian 6.1.99-1

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Adding the “WEBHOOK_URL” environmental variable and setting it to my subdomain fixed my problem: Configure webhook URLs with reverse proxy | n8n Docs

Webhooks and triggers are now working.

1 Like

Hey @ken_chris,

It would be worth removing WEBHOOK_TUNNEL_URL as well as it isn’t needed.

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