Enable caching of hydra.nixos.org in the reverse proxy
Eelco Dolstra committed
Nov 11, 2014 at 10:57 UTC
86948ea3eb6849e68b4940ca5aa76ebe4c72b3b4
1 file changed
+14
-1
delft/delft-webserver.nix
+14
-1
@@ -55,6 +55,8 @@ let
55
'';
56
};
57
58
+ hydraCacheDir = "/var/cache/hydra-binary-cache";
59
+
60
hydraProxyConfig =
61
''
62
TimeOut 900
@@ -69,6 +71,10 @@ let
71
ProxyPass / http://lucifer:3000/ retry=5 disablereuse=on
72
ProxyPassReverse / http://lucifer:3000/
73
74
+ CacheEnable disk /
75
+ CacheRoot ${hydraCacheDir}
76
+ CacheMaxFileSize 64000000
77
+
78
<Location />
79
SetOutputFilter DEFLATE
80
BrowserMatch ^Mozilla/4\.0[678] no-gzip\
@@ -90,7 +96,8 @@ in
96
adminAddr = "e.dolstra@tudelft.nl";
97
hostName = "localhost";
98
93
- extraModules = ["deflate"];
99
+ extraModules = [ "deflate" "cache" "disk_cache" ];
100
+
101
extraConfig =
102
''
103
AddType application/nix-package .nixpkg
@@ -267,4 +274,10 @@ in
274
275
environment.systemPackages = [ zabbixMail ];
276
277
+ system.activationScripts.createHydraCache =
278
+ ''
279
+ mkdir -p ${hydraCacheDir}
280
+ chown wwwrun ${hydraCacheDir}
281
+ '';
282
+
283
}