Skip to content

Instantly share code, notes, and snippets.

@roman-wb
Last active January 28, 2020 10:26
Show Gist options
  • Select an option

  • Save roman-wb/c53df25ae7823c7726a112e1cd6ae499 to your computer and use it in GitHub Desktop.

Select an option

Save roman-wb/c53df25ae7823c7726a112e1cd6ae499 to your computer and use it in GitHub Desktop.
Telegram bot api with proxy nginx host
//
https://<domain>/bot<token>/sendMessage?chat_id=<chat_or_channel>&parse_mode=html&disable_notification=true&text=Test
server {
...
server_name <domain>;
...
location /bot {
resolver 8.8.8.8;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
set $url https://api.telegram.org;
proxy_pass $url;
client_max_body_size 10M;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment