1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-08-02 13:07:46 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
7302727cfc
nginx: fix missing headers 2025-06-03 06:27:46 +03:00
4b9209bc97
nginx: cache headers for site 2025-06-03 06:23:58 +03:00

View file

@ -7,11 +7,26 @@ in {
imports = [(self + /modules/nginx.nix)];
services.nginx = enabled {
appendHttpConfig = /* nginx */ ''
# Cache only successful responses.
map $status $cache_header {
200 "public";
302 "public";
default "no-cache";
}
'';
virtualHosts.${domain} = merge config.services.nginx.sslTemplate {
inherit root;
locations."/".tryFiles = "$uri $uri.html $uri/index.html =404";
locations."~ ^/assets/(fonts|icons|images)/".extraConfig = /* nginx */ ''
expires max;
${config.services.nginx.headers}
add_header Cache-Control $cache_header always;
'';
extraConfig = /* nginx */ ''
error_page 404 /404.html;
'';