521xueweihan / GitHub520

:kissing_heart: 让你“爱”上 GitHub,解决访问时图裂、加载慢的问题。(无需安装)
21.33k stars 2.15k forks source link

解决办法:raw.hellogithub.com 502 异常 #130

Open NewStorm-0 opened 2 years ago

NewStorm-0 commented 2 years ago

大家有没有遇到类似的问题呢

7a6163 commented 2 years ago

偶爾會發生 502 Bad Gateway

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>

我的解決方式,最後在清除掉多餘的錯誤 0 */1 * * * /usr/bin/sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts && /usr/bin/sed -i "/<html>/, /<\/html>/d" /etc/hosts

taotieren commented 10 months ago

我这边测试发现用 curl 会有类似的问题,后面改用 wget 后没有了 我在 systemd 中增加两个下载地址,也是防止主连接挂掉后无法更新,可以通过第二个连接获取更新。https://github.com/521xueweihan/GitHub520/pull/212