13

如何解决阿里云访问Github.com慢的问题

 2 years ago
source link: https://foofish.net/aliyun_access_github_slowlyu.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

如何解决阿里云访问Github.com慢的问题

By 刘志军, 2021-10-22, 分类: 其它

github

最近在折腾remark42开源评论系统,帐号登录授权是基于GitHub,用户通过OAuth方式授权获取GitHub的信息时,我的服务器需要访问github的服务,由于我的服务器是国内的阿里云服务器。所以经常会出现访问github.com 超时的问题,最后就导致用户无法完成GitHub授权登录。

网上找到一个方法,通过修改服务器hosts文件来解决

首先在 https://www.ipaddress.com 找到 github.com和github.global.ssl.fastly.net对应的IP地址

微信截图_20211022225902.png

vim /etc/hosts

添加如下内容

140.82.114.4    github.com
199.232.5.194   github.global.ssl.fastly.net

最后重新 ping github.com 得到了响应。

微信截图_20211022225629.png

其它网站如果遇到类似访问超时都可以用该方法来解决

有问题可以扫描二维码和我交流

关注公众号「Python之禅」,回复「1024」免费获取Python资源

python之禅

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK