forked from nixcn/nixcn-cms
25
devenv.nix
25
devenv.nix
@@ -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
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user