@cryptotaxi247 / infra / commits / 35fe53d6

Remove duplication

Eelco Dolstra committed Nov 11, 2014 at 10:50 UTC 35fe53d62f3349b68d683dd960ebe035dafbcaa1
1 file changed +28 -51
delft/delft-webserver.nix
+28 -51
@@ -15,7 +15,7 @@ let
15 ${pkgs.ssmtp}/sbin/sendmail -v $zabbixemailto <<EOF
16 Subject: $zabbixsubject
17 To: $zabbixemailto
18 -
18 +
19 $zabbixbody
20 EOF
21 '';
@@ -55,6 +55,30 @@ let
55 '';
56 };
57
58 + hydraProxyConfig =
59 + ''
60 + TimeOut 900
61 +
62 + <Proxy *>
63 + Order deny,allow
64 + Allow from all
65 + </Proxy>
66 +
67 + ProxyRequests Off
68 + ProxyPreserveHost On
69 + ProxyPass / http://lucifer:3000/ retry=5 disablereuse=on
70 + ProxyPassReverse / http://lucifer:3000/
71 +
72 + <Location />
73 + SetOutputFilter DEFLATE
74 + BrowserMatch ^Mozilla/4\.0[678] no-gzip\
75 + BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
76 + SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
77 + SetEnvIfNoCase Request_URI /api/ no-gzip dont-vary
78 + SetEnvIfNoCase Request_URI /download/ no-gzip dont-vary
79 + </Location>
80 + '';
81 +
82 in
83
84 {
@@ -192,38 +216,10 @@ in
216 ];
217 }
218
195 -/*
196 - { hostName = "hydra.nixos.org";
197 - globalRedirect = "https://hydra.nixos.org/";
198 - }
199 -*/
200 -
219 { hostName = "hydra.nixos.org";
220
221 logFormat = ''"%h %l %u %t \"%r\" %>s %b %D"'';
204 - extraConfig = ''
205 - TimeOut 900
206 -
207 - <Proxy *>
208 - Order deny,allow
209 - Allow from all
210 - </Proxy>
211 -
212 - ProxyRequests Off
213 - ProxyPreserveHost On
214 - ProxyPass / http://lucifer:3000/ retry=5 disablereuse=on
215 - ProxyPassReverse / http://lucifer:3000/
216 -
217 - <Location />
218 - SetOutputFilter DEFLATE
219 - BrowserMatch ^Mozilla/4\.0[678] no-gzip\
220 - BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
221 - SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
222 - SetEnvIfNoCase Request_URI /api/ no-gzip dont-vary
223 - SetEnvIfNoCase Request_URI /download/ no-gzip dont-vary
224 - </Location>
225 -
226 - '';
222 + extraConfig = hydraProxyConfig;
223 }
224
225 { hostName = "hydra.nixos.org";
@@ -234,33 +230,14 @@ in
230
231 logFormat = ''"%h %l %u %t \"%r\" %>s %b %D"'';
232 extraConfig = ''
237 - TimeOut 900
238 -
233 SSLCertificateChainFile /root/ssl-secrets/startssl-class1.pem
234 SSLCACertificateFile /root/ssl-secrets/startssl-ca.pem
235 +
236 # Required by Catalyst.
237 RequestHeader set X-Forwarded-Proto https
238 RequestHeader set X-Forwarded-Port 443
239
245 - <Proxy *>
246 - Order deny,allow
247 - Allow from all
248 - </Proxy>
249 -
250 - ProxyRequests Off
251 - ProxyPreserveHost On
252 - ProxyPass / http://lucifer:3000/ retry=5 disablereuse=on
253 - ProxyPassReverse / http://lucifer:3000/
254 -
255 - <Location />
256 - SetOutputFilter DEFLATE
257 - BrowserMatch ^Mozilla/4\.0[678] no-gzip\
258 - BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
259 - SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
260 - SetEnvIfNoCase Request_URI /api/ no-gzip dont-vary
261 - SetEnvIfNoCase Request_URI /download/ no-gzip dont-vary
262 - </Location>
263 -
240 + ${hydraProxyConfig}
241 '';
242 }
243