Roskomnadzor and Telegram bots through the proxy
It's better to advertise for a perfect messenger and it's impossible to think up - "the unyielding Durov keeps the defense and stands for the confidentiality of his clients, as for his life." But the essence of this post is not in the marketing component of the Telegram blocking in the territory of Russia. If your Telegram bot stopped working and you need to restore this work urgently, welcome to the cat.
https://api.telegram.org/ for each action of the bot's Telegram, and this address is, of course, blocked by the ILV.
As an express solution to the problem, it immediately occurred to connect the client API server to our OpenVPN network to bypass this lock. The decision was immediately rejected; the speed of response left much to be desired. Google and Yandex could not share with me useful information on the solution of this issue.
As a result, a simple and obvious idea came to mind: to raise a very simple proxy server for connection in telegrams. Below is provided a configuration of nginx which is now perfectly able to cope with its task
Nginx config [/b]
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;
proxy_pass https://api.telegram.org/ ;
Further in the application, I changed the url BOT API to interact with the telegram - instead of
and integration with Bot Api has successfully earned
For more convenience, created a docker container with detailed instructions for its use. This will allow you to raise your telegram bot proxy with one command in seconds
Example of the command:
docker run -d -p 8012: 80 zvinger /docker-proxy-rkn
and specify http: //address.server: 8012 / in the application configuration. You can select any port when you type
It may be interesting
Helpful information. Fortunate me I discovered your web site accidentally,
and I am stunned why this accident did not happen earlier! I bookmarked it. Thanks, I've recently been looking for information about this topic for [hide]a[https://www.pizzahutcouponcode.com/pizza-hut-coupons-code/
] long time and yours is the greatest I've discovered so far. But, what concerning the conclusion? Are you positive about the source?