Fix caddy api proxy

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-25 13:14:30 +08:00
parent 942767aed3
commit 9c7cfb3da6
2 changed files with 20 additions and 17 deletions

View File

@@ -26,14 +26,23 @@
enable = true;
dataDir = "${config.env.DEVENV_STATE}/caddy";
config = ''
{
debug
}
:8080 {
root * ${config.env.DEVENV_ROOT}/.outputs/static
file_server
reverse_proxy /api/v1/* http://127.0.0.1:8000
}
:8080 {
handle /api/* {
reverse_proxy 127.0.0.1:8000
}
handle {
root * ${config.env.DEVENV_ROOT}/.outputs/static
encode zstd gzip
@assets path /assets/*
header @assets Cache-Control "public, max-age=31536000, immutable"
try_files {path} /index.html
file_server
}
}
'';
};