fork from d7z-project/caddy-gitea-pages

This commit is contained in:
“xHuPo” 2024-09-14 11:53:32 +08:00
parent 50a258ea59
commit 9d86fd33c6
86 changed files with 2452 additions and 4500 deletions

47
Caddyfile Normal file
View file

@ -0,0 +1,47 @@
{
order gitea before file_server
auto_https disable_redirects
}
(default) {
# Gitea 服务器地址
server https://gitea.com
# Gitea Token需要 organization:read、repository:read、user:read 权限
token please-replace-it
# 默认域名,类似于 Github 的 github.io
domain example.com
# CNAME 配置保存地址
# shared: 在 caddy 实例中共享 alias一般不建议使用
alias path/to/file shared
# 配置缓存 (缓存刷新时间, 文件缓存时间 , 最大单文件缓存大小)
cache 30s 24h 1MB
# 默认 返回 Header可以配置同源策略或更多内容
headers {
Access-Control-Allow-Origin *
}
errors {
# 默认 404 页面,可填写路径或者 URL
404 path/to/file
# 默认 40x 页面,可填写路径或者 URL
40x path/to/file
# 默认 50x 页面,可填写路径或者 URL
50x path/to/file
# 默认 500 页面,可填写路径或者 URL
500 path/to/file
}
# 开启重定向 scheme port
redirect https 302
}
http:// {
import default
}
https:// {
## 填入 https 配置
# tls
import default
}