github加速返回403 #35

Closed
opened 2025-07-18 15:46:28 +08:00 by sparkssssssss · 11 comments
sparkssssssss commented 2025-07-18 15:46:28 +08:00 (Migrated from github.com)

docker部署,
镜像代理没有问题,
测试github加速返回403
看服务端日志,似乎是https://xxxx 变为了https:/xxxx导致的,

Image

客户端

wget https://mydomain.com/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz
--2025-07-18 15:43:12--  https://mydomain.com/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz
Resolving mydomain.com (mydomain.com)... 172.67.203.219, 104.21.85.82
Connecting to mydomain.com (mydomain.com)|172.67.203.219|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2025-07-18 15:43:14 ERROR 403: Forbidden.


服务端
 HubProxy 启动成功
 监听地址: 0.0.0.0:5000
⚡ 限流配置: 500请求/1小时
 项目地址: https://github.com/sky22333/hubproxy
[GIN] 2025/07/18 - 07:39:58 | 200 |     1.51408ms |  104.23.166.119 | GET      "/"
[GIN] 2025/07/18 - 07:40:00 | 200 |      22.084µs |   172.68.211.35 | GET      "/favicon.ico"
[GIN] 2025/07/18 - 07:40:08 | 200 |       86.45µs |  104.23.166.119 | GET      "/search.html"
[GIN] 2025/07/18 - 07:40:11 | 200 |      65.733µs |  104.23.166.119 | GET      "/images.html"
[GIN] 2025/07/18 - 07:40:19 | 200 |      68.158µs |  104.23.166.119 | GET      "/"
请求IP: 172.71.99.82 (提纯后: 172.71.99.82), X-Forwarded-For: 172.71.99.82, X-Real-IP: 
[GIN] 2025/07/18 - 07:41:00 | 200 |    1.838622ms |    172.71.99.82 | GET      "/v2/"
请求IP: 172.70.46.24 (提纯后: 172.70.46.24), X-Forwarded-For: 172.70.46.24, X-Real-IP: 
[GIN] 2025/07/18 - 07:41:03 | 200 |  1.642696723s |    172.70.46.24 | GET      "/v2/busybox/manifests/latest"
请求IP: 172.70.47.193 (提纯后: 172.70.47.193), X-Forwarded-For: 172.70.47.193, X-Real-IP: 
[GIN] 2025/07/18 - 07:41:06 | 200 |  721.701725ms |   172.70.47.193 | GET      "/v2/busybox/manifests/sha256:7c0ffe5751238c8479f952f3fbc3b719d47bccac0e9bf0a21c77a27cba9ef12d"
请求IP: 172.71.182.14 (提纯后: 172.71.182.14), X-Forwarded-For: 172.71.182.14, X-Real-IP: 
请求IP: 104.23.166.48 (提纯后: 104.23.166.48), X-Forwarded-For: 104.23.166.48, X-Real-IP: 
[GIN] 2025/07/18 - 07:41:09 | 200 |  1.616902061s |   172.71.182.14 | GET      "/v2/busybox/blobs/sha256:90b9666d4aed1893ff122f238948dfd5e8efdcf6c444fe92371ea0f01750bf8c"
[GIN] 2025/07/18 - 07:41:10 | 200 |  1.216288599s |   104.23.166.48 | GET      "/v2/busybox/blobs/sha256:6d3e4188a38af91b0c1577b9e88c53368926b2fe0e1fb985d6e8a70040520c4d"
请求IP: 172.68.211.35 (提纯后: 172.68.211.35), X-Forwarded-For: 172.68.211.35, X-Real-IP: 
[GIN] 2025/07/18 - 07:42:49 | 403 |      40.284µs |   172.68.211.35 | GET      "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz"
请求IP: 104.23.170.103 (提纯后: 104.23.170.103), X-Forwarded-For: 104.23.170.103, X-Real-IP: 
[GIN] 2025/07/18 - 07:43:14 | 403 |      36.744µs |  104.23.170.103 | GET      "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz"
docker部署, 镜像代理没有问题, 测试github加速返回403 看服务端日志,似乎是https://xxxx 变为了https:/xxxx导致的, <img width="1415" height="218" alt="Image" src="https://github.com/user-attachments/assets/2572ae39-ac24-435e-95df-c731f4e04713" /> 客户端 ```` wget https://mydomain.com/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz --2025-07-18 15:43:12-- https://mydomain.com/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz Resolving mydomain.com (mydomain.com)... 172.67.203.219, 104.21.85.82 Connecting to mydomain.com (mydomain.com)|172.67.203.219|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2025-07-18 15:43:14 ERROR 403: Forbidden. 服务端 HubProxy 启动成功 监听地址: 0.0.0.0:5000 ⚡ 限流配置: 500请求/1小时 项目地址: https://github.com/sky22333/hubproxy [GIN] 2025/07/18 - 07:39:58 | 200 | 1.51408ms | 104.23.166.119 | GET "/" [GIN] 2025/07/18 - 07:40:00 | 200 | 22.084µs | 172.68.211.35 | GET "/favicon.ico" [GIN] 2025/07/18 - 07:40:08 | 200 | 86.45µs | 104.23.166.119 | GET "/search.html" [GIN] 2025/07/18 - 07:40:11 | 200 | 65.733µs | 104.23.166.119 | GET "/images.html" [GIN] 2025/07/18 - 07:40:19 | 200 | 68.158µs | 104.23.166.119 | GET "/" 请求IP: 172.71.99.82 (提纯后: 172.71.99.82), X-Forwarded-For: 172.71.99.82, X-Real-IP: [GIN] 2025/07/18 - 07:41:00 | 200 | 1.838622ms | 172.71.99.82 | GET "/v2/" 请求IP: 172.70.46.24 (提纯后: 172.70.46.24), X-Forwarded-For: 172.70.46.24, X-Real-IP: [GIN] 2025/07/18 - 07:41:03 | 200 | 1.642696723s | 172.70.46.24 | GET "/v2/busybox/manifests/latest" 请求IP: 172.70.47.193 (提纯后: 172.70.47.193), X-Forwarded-For: 172.70.47.193, X-Real-IP: [GIN] 2025/07/18 - 07:41:06 | 200 | 721.701725ms | 172.70.47.193 | GET "/v2/busybox/manifests/sha256:7c0ffe5751238c8479f952f3fbc3b719d47bccac0e9bf0a21c77a27cba9ef12d" 请求IP: 172.71.182.14 (提纯后: 172.71.182.14), X-Forwarded-For: 172.71.182.14, X-Real-IP: 请求IP: 104.23.166.48 (提纯后: 104.23.166.48), X-Forwarded-For: 104.23.166.48, X-Real-IP: [GIN] 2025/07/18 - 07:41:09 | 200 | 1.616902061s | 172.71.182.14 | GET "/v2/busybox/blobs/sha256:90b9666d4aed1893ff122f238948dfd5e8efdcf6c444fe92371ea0f01750bf8c" [GIN] 2025/07/18 - 07:41:10 | 200 | 1.216288599s | 104.23.166.48 | GET "/v2/busybox/blobs/sha256:6d3e4188a38af91b0c1577b9e88c53368926b2fe0e1fb985d6e8a70040520c4d" 请求IP: 172.68.211.35 (提纯后: 172.68.211.35), X-Forwarded-For: 172.68.211.35, X-Real-IP: [GIN] 2025/07/18 - 07:42:49 | 403 | 40.284µs | 172.68.211.35 | GET "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz" 请求IP: 104.23.170.103 (提纯后: 104.23.170.103), X-Forwarded-For: 104.23.170.103, X-Real-IP: [GIN] 2025/07/18 - 07:43:14 | 403 | 36.744µs | 104.23.170.103 | GET "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz" ````
sky22333 commented 2025-07-18 15:51:30 +08:00 (Migrated from github.com)

地址有问题,应该是https://,你提供的最后一行日志是https:/

地址有问题,应该是`https://`,你提供的最后一行日志是`https:/`
sparkssssssss commented 2025-07-18 15:52:39 +08:00 (Migrated from github.com)

地址有问题,应该是https://,你提供的最后一行日志是https:/

这个是项目自己变的,看我终端和浏览器,均是正常的地址,但是服务端日志变了

> 地址有问题,应该是`https://`,你提供的最后一行日志是`https:/` 这个是项目自己变的,看我终端和浏览器,均是正常的地址,但是服务端日志变了
sky22333 commented 2025-07-18 15:54:55 +08:00 (Migrated from github.com)
奇怪,demo站是正常的:https://demo.52013120.xyz/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz
sparkssssssss commented 2025-07-18 15:57:16 +08:00 (Migrated from github.com)

奇怪,demo站是正常的:https://demo.52013120.xyz/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz

不确定是否我前面套了一层caddy导致的,我抓包看,是反代传过来的时候,就变了,我验证下先

> 奇怪,demo站是正常的:https://demo.52013120.xyz/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz 不确定是否我前面套了一层caddy导致的,我抓包看,是反代传过来的时候,就变了,我验证下先
sky22333 commented 2025-07-18 15:58:13 +08:00 (Migrated from github.com)

我demo站也是caddy反代的

我demo站也是caddy反代的
sky22333 commented 2025-07-18 16:06:32 +08:00 (Migrated from github.com)

@sparkssssssss 你直接在机器本地通过代理下载试试,如果能成功,就是前置的问题,例如caddy或者cdn的问题

wget 127.0.0.1:5000/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz
@sparkssssssss 你直接在机器本地通过代理下载试试,如果能成功,就是前置的问题,例如caddy或者cdn的问题 ``` wget 127.0.0.1:5000/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz ```
sparkssssssss commented 2025-07-18 16:20:49 +08:00 (Migrated from github.com)

@sparkssssssss 你直接在机器本地通过代理下载试试,如果能成功,就是前置的问题,例如caddy或者cdn的问题

wget 127.0.0.1:5000/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz

大概率是caddy的问题,因为传过来就变了
https://github.com/caddyserver/caddy/issues/1298
看这个issue,似乎这就是caddy的处理方式,
/usr/bin/caddy -v
v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=

我的版本,是这个,和你的版本对比下?
配置方便的话,也分享下吧,我基本都用nginx,这个机器上,有一个一键脚本配合caddy用的,没想到还有这一出

> [@sparkssssssss](https://github.com/sparkssssssss) 你直接在机器本地通过代理下载试试,如果能成功,就是前置的问题,例如caddy或者cdn的问题 > > ``` > wget 127.0.0.1:5000/https://github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_darwin_amd64.tar.gz > ``` 大概率是caddy的问题,因为传过来就变了 https://github.com/caddyserver/caddy/issues/1298 看这个issue,似乎这就是caddy的处理方式, /usr/bin/caddy -v v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk= 我的版本,是这个,和你的版本对比下? 配置方便的话,也分享下吧,我基本都用nginx,这个机器上,有一个一键脚本配合caddy用的,没想到还有这一出
sky22333 commented 2025-07-18 16:33:48 +08:00 (Migrated from github.com)

我用的caddy最新版本v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=

我是Debian系统,通过apt包安装的:

sudo apt install -yq debian-keyring debian-archive-keyring apt-transport-https curl && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && sudo apt update -q && sudo apt install -yq caddy

反代配置见:README.md

我用的caddy最新版本`v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=` 我是Debian系统,通过apt包安装的: ``` sudo apt install -yq debian-keyring debian-archive-keyring apt-transport-https curl && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && sudo apt update -q && sudo apt install -yq caddy ``` 反代配置见:[README.md](https://github.com/sky22333/hubproxy?tab=readme-ov-file#%EF%B8%8F-%E9%85%8D%E7%BD%AE)
sparkssssssss commented 2025-07-18 17:12:50 +08:00 (Migrated from github.com)

我用的caddy最新版本v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=

我是Debian系统,通过apt包安装的:

sudo apt install -yq debian-keyring debian-archive-keyring apt-transport-https curl && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && sudo apt update -q && sudo apt install -yq caddy

反代配置见:README.md

升级到2.10 还是不行,不懂了.

/usr/bin/caddy -v 
v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=

[GIN] 2025/07/18 - 09:10:34 | 403 |      69.961µs |      172.17.0.1 | GET      "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz"

mydomain.com {
    reverse_proxy {
        to 127.0.0.1:5000
        header_up X-Real-IP {remote}
        header_up X-Forwarded-For {remote}
        header_up X-Forwarded-Proto {scheme}
    }
}

> 我用的caddy最新版本`v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=` > > 我是Debian系统,通过apt包安装的: > > ``` > sudo apt install -yq debian-keyring debian-archive-keyring apt-transport-https curl && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list && sudo apt update -q && sudo apt install -yq caddy > ``` > > 反代配置见:[README.md](https://github.com/sky22333/hubproxy?tab=readme-ov-file#%EF%B8%8F-%E9%85%8D%E7%BD%AE) 升级到2.10 还是不行,不懂了. ```` /usr/bin/caddy -v v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U= [GIN] 2025/07/18 - 09:10:34 | 403 | 69.961µs | 172.17.0.1 | GET "/https:/github.com/nadoo/glider/releases/download/v0.16.4/glider_0.16.4_linux_amd64.tar.gz" mydomain.com { reverse_proxy { to 127.0.0.1:5000 header_up X-Real-IP {remote} header_up X-Forwarded-For {remote} header_up X-Forwarded-Proto {scheme} } } ````
sky22333 commented 2025-07-18 17:20:54 +08:00 (Migrated from github.com)

我感觉这个可能跟你客户端有关,不是服务端的问题,你用手机浏览器试试,或者可以进TG群帮你看看:https://t.me/hubproxy12345

我感觉这个可能跟你客户端有关,不是服务端的问题,你用手机浏览器试试,或者可以进TG群帮你看看:https://t.me/hubproxy12345
sky22333 commented 2025-07-18 18:11:34 +08:00 (Migrated from github.com)

已找到原因,CF的问题,开启了标准化传入到源服务器的 URL选项导致的

已找到原因,CF的问题,开启了`标准化传入到源服务器的 URL`选项导致的
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/hubproxy#35