mirror of
https://github.com/RGBCube/ncc
synced 2025-08-05 14:37:47 +00:00
Compare commits
No commits in common. "7302727cfc9051b71140e87be5af2795de7aaab4" and "9904b03908af207e6f7d028622a4c3583ce65176" have entirely different histories.
7302727cfc
...
9904b03908
1 changed files with 0 additions and 15 deletions
|
@ -7,26 +7,11 @@ in {
|
||||||
imports = [(self + /modules/nginx.nix)];
|
imports = [(self + /modules/nginx.nix)];
|
||||||
|
|
||||||
services.nginx = enabled {
|
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 {
|
virtualHosts.${domain} = merge config.services.nginx.sslTemplate {
|
||||||
inherit root;
|
inherit root;
|
||||||
|
|
||||||
locations."/".tryFiles = "$uri $uri.html $uri/index.html =404";
|
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 */ ''
|
extraConfig = /* nginx */ ''
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue