Last active
January 28, 2020 10:26
-
-
Save roman-wb/c53df25ae7823c7726a112e1cd6ae499 to your computer and use it in GitHub Desktop.
Telegram bot api with proxy nginx host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| 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