我从certbot添加ssl证书。并尝试将此example与我的令牌,端口,URL等一起使用。
我运行脚本,然后使用此链接save(x, file = "aux_file.RData")
检查状态并获得答案https://api.telegram.org/bot827929874:AAELa-Dl6pYFM_test_test/getWebhookInfo
。我看到现在有32条消息正在等待队列中。为何机器人没有响应?
UPD: 将Nginx配置重写为:
{"ok":true,"result":{"url":"https://my_site.com:88/827929874:AAELa-Dl6pYFM_test_test/","has_custom_certificate":true,"pending_update_count":32,"max_connections":40}}
在python脚本中将端口更改为443。如果在server{
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
listen 80; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site.comprivkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
上请求,则仍会发生错误Connection timed out
Telegram的api已从服务器ping通。