padeoe / hf-mirror-site

a huggingface mirror site.
https://hf-mirror.com
236 stars 29 forks source link

[求助]尝试部署失败 #20

Closed Kinsue closed 8 months ago

Kinsue commented 8 months ago

对项目代码做了如下修改 image

Caddy 报错

2024/03/21 12:59:12.036 error http.log.access.hf handled request {"request": {"remote_ip": "106.224.43.91", "remote_port": "55701", "client_ip": "106.224.43.91", "proto": "HTTP/3.0", "method": "GET", "host": "kinsue.com", "uri": "/", "headers": {"Sec-Fetch-Site": ["cross-site"], "Sec-Fetch-Mode": ["navigate"], "Accept-Encoding": ["gzip, deflate, br, zstd"], "Sec-Ch-Ua": ["\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\""], "Dnt": ["1"], "Sec-Fetch-User": ["?1"], "Sec-Fetch-Dest": ["document"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"], "Cache-Control": ["max-age=0"], "Sec-Ch-Ua-Mobile": ["?0"], "Upgrade-Insecure-Requests": ["1"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7"], "Accept-Language": ["zh-CN,zh;q=0.9"]}, "tls": {"resumed": true, "version": 772, "cipher_suite": 4865, "proto": "h3", "server_name": "kinsue.com"}}, "bytes_read": 0, "user_id": "", "duration": 0.000178644, "size": 0, "status": 404, "resp_headers": {"Server": ["kinsue.com"], "Cache-Control": ["no-cache"], "Date": ["Thu, 21 Mar 2024 12:59:12 GMT"]}}

image

CloudFlare DNS 配置如下: image 请问是什么原因导致的,该怎么排查呢? @padeoe 😢

padeoe commented 8 months ago

报错404可能是因为这行代码导致的: https://github.com/padeoe/hf-mirror-site/blob/5c8fa2814471eda2f3e16a08b16ab45195b14a20/scripts/caddy/hf-mirror.com.Caddyfile#L47

root *后面接的应该是本项目dist目录的所在路径,这个点忘记在readme里写了。

可以通过在 Caddyfile 中第一行开启 debug 模式查看详细日志输出确定问题

Kinsue commented 8 months ago

非常感谢,修改这个路径到dist目录后可以了