AFFiNE/.github/deployment/Caddyfile

41 lines
554 B
Caddyfile
Raw Normal View History

2022-12-20 10:22:36 +03:00
:80 {
root /* ./dist
file_server {
# precompressed br
}
encode {
zstd
gzip 9
}
header {
# 7 days
Cache-Control "public, max-age=86400, must-revalidate"
}
handle /api/* {
2022-12-20 10:22:36 +03:00
reverse_proxy {$API_SERVER} {
health_uri /api/healthz
2022-12-20 10:22:36 +03:00
@error status 500 502 503 503
handle_response @error {
root * /dist
rewrite * /50x.html
file_server
}
}
}
@notStatic {
not path /_next/static/*
}
handle @notStatic {
header {
Cache-Control "no-cache, no-store, must-revalidate"
}
try_files {path} /index.html
}
}