Commit 8296c7b021fe

Vincent Demeester <vincent@sbr.pm>
2018-12-16 17:34:35
nix-binary-cache: fix cache path
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent efbf79d
Changed files (1)
modules
modules/services/nix-binary-cache.nix
@@ -23,7 +23,7 @@ in
     services.nginx = {
       enable = true;
       appendHttpConfig = ''
-        proxy_cache_path /tmp/cache/ levels=1:2 keys_zone=cachecache:100m max_size=10g inactive=365d use_temp_path=off;
+        proxy_cache_path /var/public-nix-cache/ levels=1:2 keys_zone=cachecache:100m max_size=10g inactive=365d use_temp_path=off;
         # Cache only success status codes; in particular we don't want to cache 404s.
         # See https://serverfault.com/a/690258/128321
         map $status $cache_header {
@@ -37,7 +37,7 @@ in
         # enableACME = true;
 
         locations."/" = {
-          root = "/var/public-nix-cache";
+          root = "/var/public-nix-cache/";
           extraConfig = ''
             expires max;
             add_header Cache-Control $cache_header always;
@@ -55,7 +55,7 @@ in
           # when the upstream host is not reachable for a short time when
           # nginx is started.
           resolver 8.8.8.8;
-          set $upstream_endpoint http://cache.nixos.org;
+          set $upstream_endpoint https://cache.nixos.org;
         '';
         locations."@fallback" = {
           proxyPass = "$upstream_endpoint";