move x-accel into local storage configuration
All checks were successful
build container / build-container (push) Successful in 5m45s
run go test / test (push) Successful in 3m15s

This commit is contained in:
2025-03-03 09:15:37 +08:00
parent 504a809c16
commit 83dfcba4ae
4 changed files with 33 additions and 29 deletions

View File

@ -88,21 +88,21 @@ upstream:
allowed-redirect: "^https?://cf-builds.garudalinux.org/.*/chaotic-aur/.*$"
misc:
first-chunk-bytes: 31457280 # 1024*1024*30, all upstreams with 200 response will wait for the first chunks to select a upstream by bandwidth, instead of by latency. defaults to 50M
# chunk-bytes: 1048576 # 1024*1024
first-chunk-bytes: 31457280 ## 1024*1024*30, all upstreams with 200 response will wait for the first chunks to select a upstream by bandwidth, instead of by latency. defaults to 50M
# chunk-bytes: 1048576 ## 1024*1024
cache:
timeout: 1h
policies:
- match: '.*\.(rpm|deb|apk|iso)$' # rpm/deb/apk/iso won't change, create only
- match: '.*\.(rpm|deb|apk|iso)$' ## rpm/deb/apk/iso won't change, create only
refresh-after: never
- match: '^/.*-security/.*' # mostly ubuntu/debian security
- match: '^/.*-security/.*' ## mostly ubuntu/debian security
refresh-after: 1h
- match: '^/archlinux-localaur/.*' # archlinux local repo
- match: '^/archlinux-localaur/.*' ## archlinux local repo
refresh-after: never
- match: '^/(archlinux.*|chaotic-aur)/*.tar.*' # archlinux packages
- match: '^/(archlinux.*|chaotic-aur)/*.tar.*' ## archlinux packages
refresh-after: never
- match: '/chaotic-aur/.*\.db$' # archlinux chaotic-aur database
- match: '/chaotic-aur/.*\.db$' ## archlinux chaotic-aur database
refresh-after: 24h
- match: '/centos/7'
refresh-after: never
@ -110,20 +110,23 @@ cache:
refresh-after: never
storage:
type: local # ignored
type: local ## ignored for now
local:
path: ./data # defaults to ./data
path: ./data ## defaults to ./data
accel:
# example nginx config:
## location /i {
## internal;
## alias /path/to/data;
## }
## location / {
## proxy_pass 127.0.0.1:8881;
## proxy_set_header X-Accel-Path /i;
## }
##
accel:
## example nginx config:
## location /i {
## internal;
## alias /path/to/data;
## }
## location / {
## proxy_pass 127.0.0.1:8881;
## proxy_set_header X-Accel-Path /i;
## }
##
## then cache proxy will respond to backend a header to indicate sendfile(join(X-Accel-Path, relpath))
# enable-by-header: "X-Accel-Path"
# enable-by-header: "X-Accel-Path"
## respond with different headers to
# respond-with-headers: [X-Sendfile, X-Accel-Redirect]