2024-01-15 11:57:36 +02:00
|
|
|
{
|
|
|
|
writeTextFile,
|
|
|
|
e11sync-static,
|
2024-01-15 16:14:46 +02:00
|
|
|
backendPort ? 8002,
|
2024-01-15 11:57:36 +02:00
|
|
|
}:
|
|
|
|
writeTextFile {
|
2024-01-20 14:10:33 +02:00
|
|
|
name = "e11sync-caddyfile";
|
2024-01-15 11:57:36 +02:00
|
|
|
text = ''
|
2024-01-26 13:48:24 +02:00
|
|
|
header /static/* Cache-Control "public, max-age=31536000, immutable"
|
2024-01-15 11:57:36 +02:00
|
|
|
|
|
|
|
route /static/* {
|
|
|
|
uri strip_prefix /static
|
|
|
|
file_server * {
|
|
|
|
root ${e11sync-static}
|
|
|
|
precompressed br gzip
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-15 16:14:46 +02:00
|
|
|
reverse_proxy http://127.0.0.1:${toString backendPort}
|
2024-01-15 11:57:36 +02:00
|
|
|
'';
|
|
|
|
}
|