ese website caching
This commit is contained in:
parent
fcffa5f79c
commit
161a4ae838
|
@ -6,12 +6,20 @@ in
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
virtualHosts."${domain}" = {
|
virtualHosts."${domain}" = {
|
||||||
locations."= /" = {
|
locations."= /" = {
|
||||||
return = "301 /2024/";
|
# temporary redirect, to avoid caching problems
|
||||||
|
return = "302 /2024/";
|
||||||
};
|
};
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
root = "/srv/web/ese/served";
|
root = "/srv/web/ese/served";
|
||||||
tryFiles = "$uri $uri/ =404";
|
tryFiles = "$uri $uri/ =404";
|
||||||
};
|
};
|
||||||
|
# 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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue