D
D
Denis Petrenko2021-06-12 23:27:50
Python
Denis Petrenko, 2021-06-12 23:27:50

How to redirect a request to a telegram bot application?

There is a server 45.45.45.54. The aiogram documentation example webhook is running on the server. The https://botbotbot.com domain redirects the request to 45.45.45.54:443. The server also has nginx with the config:

server {
  listen 443;
  server_name 45.45.45.54;
  
  location / {
    proxy_pass localhost:3001;
  }
}

Webhook output:
{"url": "45.45.45.54", "has_custom_certificate": false, "pending_update_count": 1, "last_error_date": 1623575279, "last_error_message": "Connection reset by peer", "max_connections": 40, "ip_address": "45.45.45.54"}

The application is respectively launched on localhost:3001, but requests do not go there (the bot can send a message). What could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-06-13
@Termoslik

ssl on / listen ssland certificates / keys in the config added? In the state you describe in the top listing, nginx will listen on port 443 without HTTPS.
Z.Y. - in proxy_passit is better to explicitly indicate the scheme, i.e. http(s)://.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question