mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
24w18b
This commit is contained in:
parent
d6b8f2b812
commit
52fdaf5f81
5 changed files with 20 additions and 49 deletions
|
|
@ -88,44 +88,11 @@
|
|||
file_server
|
||||
import cache 0s 24h
|
||||
}
|
||||
handle_errors {
|
||||
@redirects `{err.status_code} in [301, 302, 307]`
|
||||
reverse_proxy @redirects {
|
||||
header_up Location {http.response.header.Location}
|
||||
}
|
||||
}
|
||||
|
||||
route /v2* {
|
||||
reverse_proxy https://registry-1.docker.io {
|
||||
header_up Host {reverse_proxy.upstream.hostport}
|
||||
header_up X-Real-IP {remote}
|
||||
header_up X-Forwarded-For {http.request.header.X-Forwarded-For}
|
||||
header_up X-Forwarded-Proto {scheme}
|
||||
header_up Authorization {http.request.header.Authorization}
|
||||
header_down WWW-Authenticate "https://auth.docker.io" "https://{host}"
|
||||
header_down Location "https://production.cloudflare.docker.com" "https://{host}"
|
||||
}
|
||||
}
|
||||
|
||||
route /token* {
|
||||
reverse_proxy https://auth.docker.io {
|
||||
header_up Host {reverse_proxy.upstream.hostport}
|
||||
header_up X-Real-IP {remote}
|
||||
header_up X-Forwarded-For {http.request.header.X-Forwarded-For}
|
||||
header_up X-Forwarded-Proto {scheme}
|
||||
header_up Authorization {http.request.header.Authorization}
|
||||
}
|
||||
}
|
||||
|
||||
route /registry-v2* {
|
||||
reverse_proxy https://production.cloudflare.docker.com {
|
||||
header_up Host {reverse_proxy.upstream.hostport}
|
||||
header_up X-Real-IP {remote}
|
||||
header_up X-Forwarded-For {http.request.header.X-Forwarded-For}
|
||||
header_up X-Forwarded-Proto {scheme}
|
||||
header_up Authorization {http.request.header.Authorization}
|
||||
}
|
||||
}
|
||||
route /api* {
|
||||
rate_limit 15r/m 10000 429
|
||||
import cache 0s 6h
|
||||
}
|
||||
}
|
||||
|
||||
import /data/caddy/config.d/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue