VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云最新优惠促销活动
jtti最新优惠促销活动

便宜国外vps论坛_如何配置 Nginx Python-Telegram-Bot WebHook

locvps
主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks

Using nginx with one domain/port for all bots

All bots set their url to the same domain and port, but with a different url_path.

The integrated server should usually be started on the localhost or 127.0.0.1 address, the port can be any port you choose.

Note: example.com could be replaced by an IP address, if you have no domain associated to your server.

Example code to start the bot:

  1. updater.start_webhook(
  2.     listen=’127.0.0.1′,
  3.     port=5000,
  4.     url_path=’TOKEN1′,
  5.     webhook_url=’https://example.com/TOKEN1′,
  6.     cert=open(‘cert.pem’, ‘rb’)
  7. )

复制代码

Example configuration for nginx (reduced to important parts) with two bots configured:

  1. server {
  2.     listen              443 ssl;
  3.     server_name         example.com;
  4.     ssl_certificate     cert.pem;
  5.     ssl_certificate_key private.key;
  6.     location /TOKEN1 {
  7.         proxy_pass http://127.0.0.1:5000/TOKEN1/;
  8.     }
  9.     location /TOKEN2 {
  10.         proxy_pass http://127.0.0.1:5001/TOKEN2/;
  11.     }
  12. }

复制代码

请问cert.pem这个文件从哪里来的?

各路大神回复说:

注册说:     ssl_certificate     cert.pem;     ssl_certificate_key private.key; 这两项是域名证书申请了,把路径地址替换就可以

主机参考zhujicankao.com_收集国内VPSVPS测评主机测评云服务器虚拟主机独立服务器国内服务器高性价比建站主机相关优惠信息
详细介绍和测评国外VPS主机,云服务器,国外服务器,国外主机的相关优惠信息,商家背景,网络带宽等等,也是目前国内最好的主机云服务器VPS参考测评资讯优惠信息分享平台

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:便宜国外vps论坛_如何配置 Nginx Python-Telegram-Bot WebHook https://zhujicankao.com/55224.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » 便宜国外vps论坛_如何配置 Nginx Python-Telegram-Bot WebHook
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

评论 抢沙发

评论前必须登录!