Telegram Trigger behind SWAG Proxy - Bad Request: bad webhook: HTTPS url must be provided for webhook

Hello
I’m completely new here and looking forward to n8n. Unfortunately my first attempt failed. But I think I know why but still need your help.

I have running n8n as a docker container behind a SWAG proxy (docs.linuxserver.io/general/swag).
This works. So I have the possibility to access with httpS and do not need a specification port.

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name n8n_web.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;
    location / {

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app n8n_web;
        set $upstream_port 5678;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

}

Now the first workflow I tried was this example - https://n8n.io/workflows/782
Telegram bot is created - credentials entered but I get this error message

Telegram Trigger: Bad Request: bad webhook: HTTPS url must be provided for webhook

I also found this I the community Issue-with-telegram-webhook/1374 (since I’m a new user I’m not allowed to have more than two links).

I assume that the internal container name is sent as webhook URL to Telegram but this is only available internally and not httpS.
How can I adjust the workflow (or the server config) so that the external URL name is sent including https e.g. n8n_web.mydomain.com.
I don’t want to start n8n with the tunnel

Thank you very much
Rob

Look like the answer is in the Issue-with-telegram-webhook/1374 - i just have not been seeing it the first three times i read it - sorry - i will try an d report back - have to adjust my docker-compose …

Welcome to the community @ico !

Did you set WEBHOOK_TUNNEL_URL to the external domain n8n is reachable at?

Because else it will try to set up a webhook for 127.0.0.1:5678 on Telegram and that would not like it or work.

You can also check the URL that gets used by clicking on “Webhook URLs”:
Screenshot from 2021-08-06 12-59-21

thanks - i was blind :slight_smile:

hi jan - super tool - I’m looking for something like this for years !!! - greetings from Munich

Great to hear that I could be useful and that you enjoy n8n!

Greetings back from Berlin! Have fun!

now i get
n8n_web_1 | timestamp: 1628248127948,
n8n_web_1 | httpCode: ‘400’,
n8n_web_1 | description: ‘Bad Request: invalid webhook URL specified’

do i have to change the webhookId: ‘806cc2c6-c687-4022-a82e-658e4a684e73’ from the workflow ?

i found wher to check the URL - took me some time - got the error

  • WEBHOOK_TUNNEL_URL=“https://n8n_web.domain.abc/”
    had “” in the config so better …
  • WEBHOOK_TUNNEL_URL=https://n8n_web.domain.abc/

Hey @ico,

Did you solve the issue? Let us know if you still need help.

the original question is answerd … but something with the telgram webhook ist still not working

Do you have a proper URL (instead of IP address) with a valid SSL certificate set on the default HTTPs port (443, so that no port has to be set in the URL)?

If Telegram says the URL is invalid there has to be a reason. There must be something out of the ordinary.

HI jan - I will try a simpler example - at the moment I only play arround and only when I have time … will get back to you if this simpler example is NOT working … Webhook Creating Endpoints Part 1 - YouTube
but i don’t exactly when i have time to try

Hello
I have played arround a bit When I create a webhook myself everything goes well. However when I create myself a Telegram trigger (similar to the imported one) it looks a bit weird.
Here is the web URL .

https://n8n_web.domain.net/webhook-test/ab3baa90-17e9-4300-8f04-e39a9f020615/webhook
https://n8n_web.domain.net/webhook/ab3baa90-17e9-4300-8f04-e39a9f020615/webhook

Why I don’t have the possibility to change the path
ab3baa90-17e9-4300-8f04-e39a9f020615
to the webhook?
why is ther a */webhook at the end?

thanks rob

@jan - it is a test system - could give you acces if you like - no important data on the server

Hey @ico,

The Webhook in the Telegram Trigger node is expected to have /webhook at the end. The webhook is generated by n8n and has to be unique. You can’t change the webhook path of any trigger nodes, except the Webhook node itself.

Did you try executing a Webhook node? Did it return the expected output?

thanks for the explanation - telegram trigger is nit working yet but i’m working on an other example to get familliar with n8n - thanks

1 Like