2019-08-02 18:41:58 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
|
|
|
services = {
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts."blog.maralorn.de" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2021-06-21 23:35:34 +00:00
|
|
|
root = "/var/cache/gc-links/blog";
|
2019-08-02 18:41:58 +00:00
|
|
|
locations = {
|
2021-06-22 01:43:41 +00:00
|
|
|
"/static" = {
|
2021-06-21 23:35:34 +00:00
|
|
|
extraConfig = ''
|
2021-06-22 01:43:41 +00:00
|
|
|
rewrite ^(.*)\.[0-9a-f]+\.(css)$ $1.$2 last;
|
2021-06-21 23:35:34 +00:00
|
|
|
expires 100y;
|
|
|
|
add_header Pragma public;
|
|
|
|
add_header Cache-Control "public";
|
|
|
|
'';
|
|
|
|
};
|
2019-08-02 18:41:58 +00:00
|
|
|
"/" = {
|
2021-06-22 01:43:41 +00:00
|
|
|
tryFiles = "$uri $uri.html $uri/index.html =404";
|
2019-08-02 18:41:58 +00:00
|
|
|
};
|
|
|
|
};
|
2021-06-22 01:43:41 +00:00
|
|
|
extraConfig = ''
|
|
|
|
error_page 404 /not-found.html;
|
|
|
|
'';
|
2019-08-02 18:41:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|