1
0
Fork 0
nixos-config/nixos/roles/blog.nix
Malte Brandy 57123b08e1 Reformat
2022-03-08 02:42:46 +01:00

34 lines
711 B
Nix

{
config,
pkgs,
lib,
...
}: {
services = {
nginx = {
enable = true;
virtualHosts."blog.maralorn.de" = {
forceSSL = true;
enableACME = true;
root = "/var/cache/gc-links/blog";
locations = {
"/static" = {
extraConfig = ''
rewrite ^(.*)\.[0-9a-f]+\.(css)$ $1.$2 last;
expires 100y;
add_header Pragma public;
add_header Cache-Control "public";
'';
};
"/" = {
tryFiles = "$uri $uri.html $uri/index.html =404";
};
};
extraConfig = ''
error_page 404 /not-found.html;
'';
};
};
};
}