1
0
Fork 0
nixos-config/nixos/roles/blog.nix
2021-06-22 03:43:41 +02:00

30 lines
704 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;
'';
};
};
};
}