2024-01-15 11:57:36 +02:00
|
|
|
{
|
|
|
|
writeTextFile,
|
|
|
|
e11sync-static,
|
|
|
|
gunicornPort ? 8002,
|
|
|
|
}:
|
|
|
|
writeTextFile {
|
|
|
|
name = "e11sync-caddy";
|
|
|
|
text = ''
|
2024-01-15 13:38:14 +02:00
|
|
|
header Strict-Transport-Security "max-age=31536000"
|
2024-01-15 11:57:36 +02:00
|
|
|
header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
|
|
|
|
route /static/* {
|
|
|
|
uri strip_prefix /static
|
|
|
|
file_server * {
|
|
|
|
root ${e11sync-static}
|
|
|
|
precompressed br gzip
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
reverse_proxy http://127.0.0.1:${toString gunicornPort}
|
|
|
|
'';
|
|
|
|
}
|