mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
36 lines
847 B
Nix
36 lines
847 B
Nix
{ ... }: {
|
|
services.caddy.globalConfig = ''
|
|
filesystem garage s3 {
|
|
bucket noratrieb.dev
|
|
region garage
|
|
endpoint http://localhost:3900
|
|
use_path_style
|
|
}
|
|
'';
|
|
services.caddy.virtualHosts = {
|
|
"noratrieb.dev" = {
|
|
logFormat = "";
|
|
extraConfig = ''
|
|
encode zstd gzip
|
|
header -Last-Modified
|
|
|
|
header /blog/css/* Cache-Control "max-age=31540000, immutable"
|
|
header /blog/fonts/* Cache-Control "max-age=31540000, immutable"
|
|
|
|
file_server {
|
|
fs garage
|
|
# TODO: run precompress script
|
|
# etag_file_extensions .sha256
|
|
# precompressed zstd gzip br
|
|
}
|
|
'';
|
|
};
|
|
"files.noratrieb.dev" = {
|
|
logFormat = "";
|
|
extraConfig = ''
|
|
encode zstd gzip
|
|
reverse_proxy * localhost:3902
|
|
'';
|
|
};
|
|
};
|
|
}
|