fruitbasket/modules/web/ese.nix

26 lines
607 B
Nix
Raw Normal View History

2024-09-26 20:11:04 +02:00
{ config, ... }:
2024-02-02 19:54:06 +01:00
let
domain = "ese.${config.networking.domain}";
in
{
services.nginx = {
virtualHosts."${domain}" = {
locations."= /" = {
2024-10-06 16:54:32 +02:00
# temporary redirect, to avoid caching problems
return = "302 /2024/";
2024-02-02 19:54:06 +01:00
};
locations."/" = {
root = "/srv/web/ese/served";
tryFiles = "$uri $uri/ =404";
};
2024-10-06 16:54:32 +02:00
# cache static assets
locations."~* \.(?:css|svg|webp|jpg|jpeg|gif|png|ico|mp4|mp3|ogg|ogv|webm|ttf|woff2|woff)$" = {
root = "/srv/web/ese/served";
extraConfig = ''
expires 1y;
'';
};
2024-02-02 19:54:06 +01:00
};
};
}