Webhook troubles

Hello! I have some troubles with webhook similar to [RESOLVED] [BUG - Node Webhook] Test webhook not working as excepted
I was setup nginx to work with Letsencrypt certificate via SSL
Now i’ve stuck with those - webhooks don’t display any data in UI and I can’t setup WF

Снимок экрана 2021-11-22 в 19.20.23

Here is part of nginx.conf

        location / {
            proxy_pass         http://web-api;
            proxy_redirect     off;
            proxy_http_version 1.1;
#            proxy_cache_bypass $http_upgrade;
            proxy_set_header   Upgrade $http_upgrade;
            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_set_header   X-Forwarded-Host $server_name;
            proxy_buffer_size           128k;
            proxy_buffers               4 256k;
            proxy_busy_buffers_size     256k;
            proxy_buffering off;
            proxy_cache off;
            chunked_transfer_encoding off;
       }

Hi @11111, welcome to the community and sorry for the trouble.

From looking at your post a few things come to my mind:

  1. The Items: 0 from the n8n UI would suggest no data has been received on the Test URL of your webhook. So I wonder hat error you are getting in the system sending the webhook?
  2. The location directive looks good to me (and I assume you have ran nginx -t to validate it). Are you able to open the n8n UI via your reverse proxy’s hostname?
  3. You don’t seem to specify a port after the web-api hostname so traffic would go to port 80. By default, n8n would, however, listen on port 5678 so you might want to check this.

Hope this provides some pointers on how to proceed :slight_smile:

Hello, @MutedJam!
Thanks for Your answer and have a nice day :slight_smile:

  1. Yes, I can’t receive any data both of test and prod webhooks, via curl from localhost too
  2. This is docker-compose images, here is compose.yml
version: "3"

services:
  nginx:
    image: nginx:1.20.2-alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /home/n8n/certs:/certs:ro
      - /home/n8n/nginx.conf/default.conf:/etc/nginx/nginx.conf:ro
  n8n:                                              
    image: n8n-python
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - ${DATA_FOLDER}/.n8n:/home/n8n
      - /home/n8n/n8n-local-files:/files
  1. If I change web-api port to 5678 - nginx brokes :frowning:
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/11/23 07:39:09 [emerg] 1#1: upstream "web-api" may not have port 5678 in /etc/nginx/nginx.conf:31
nginx: [emerg] upstream "web-api" may not have port 5678 in /etc/nginx/nginx.conf:31

Based on your docker compose file it looks like n8n is available as n8n, not as web-api. So your nginx configuration would point to an invalid hostname unless I am missing something here. See Networking in Compose | Docker Documentation for details on networking in docker-compose.

Thanks, nginx started after changing to n8n:5678 =)
But main trouble stay alive, I can’t get data to webhook

What error are you seeing in the tool sending the webook? And what happens when opening the server name configured in nginx in a browser?

I’ve see no errors =)
This case make me stuck
I’ve try to connect Slack event listener app to my n8n instance and need to response with challenge 1st time
Tried to use some webhook proxy (https://dev.oscato.com/) and there is full request
But there’s no any data in webhook to setup automatic challenge response :frowning:
Снимок экрана 2021-11-23 в 12.17.15

While change to GET and open webhook URL in browser - all is ok:
Снимок экрана 2021-11-23 в 12.19.19

But not with POST hook

So the URL is working in your own network? That’s good news and would suggest the configuration is working in principle.

Is it just the POST request from Slack that doesn’t appear in n8n/do requests from other external sources reach your n8n instance? E.g. does sending a simple request from curl/Postman/Insomnia on a machine outside your network reach your nginx revers proxy and your n8n instance?

1 Like

@MutedJam, thanks for Your help
I’ve figured out, trouble was in nginx redirect from foreign networks :heart_eyes:

1 Like

Awesome, glad to hear this is now working for you! Thanks a lot for confirming and enjoy your automation journey :slight_smile: