summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/mime.types80
-rw-r--r--ymir.nix55
2 files changed, 135 insertions, 0 deletions
diff --git a/custom/mime.types b/custom/mime.types
new file mode 100644
index 00000000..8a218b22
--- /dev/null
+++ b/custom/mime.types
@@ -0,0 +1,80 @@
1
2types {
3 text/html html htm shtml;
4 text/css css;
5 text/xml xml;
6 image/gif gif;
7 image/jpeg jpeg jpg;
8 application/x-javascript js;
9 application/atom+xml atom;
10 application/rss+xml rss;
11
12 text/mathml mml;
13 text/plain txt;
14 text/vnd.sun.j2me.app-descriptor jad;
15 text/vnd.wap.wml wml;
16 text/x-component htc;
17
18 image/png png;
19 image/tiff tif tiff;
20 image/vnd.wap.wbmp wbmp;
21 image/x-icon ico;
22 image/x-jng jng;
23 image/x-ms-bmp bmp;
24 image/svg+xml svg svgz;
25 image/webp webp;
26
27 application/java-archive jar war ear;
28 application/mac-binhex40 hqx;
29 application/msword doc;
30 application/pdf pdf;
31 application/postscript ps eps ai;
32 application/rtf rtf;
33 application/vnd.ms-excel xls;
34 application/vnd.ms-powerpoint ppt;
35 application/vnd.wap.wmlc wmlc;
36 application/vnd.google-earth.kml+xml kml;
37 application/vnd.google-earth.kmz kmz;
38 application/x-7z-compressed 7z;
39 application/x-cocoa cco;
40 application/x-java-archive-diff jardiff;
41 application/x-java-jnlp-file jnlp;
42 application/x-makeself run;
43 application/x-perl pl pm;
44 application/x-pilot prc pdb;
45 application/x-rar-compressed rar;
46 application/x-redhat-package-manager rpm;
47 application/x-sea sea;
48 application/x-shockwave-flash swf;
49 application/x-stuffit sit;
50 application/x-tcl tcl tk;
51 application/x-x509-ca-cert der pem crt;
52 application/x-xpinstall xpi;
53 application/xhtml+xml xhtml;
54 application/zip zip;
55
56 application/octet-stream bin exe dll;
57 application/octet-stream deb;
58 application/octet-stream dmg;
59 application/octet-stream eot;
60 application/octet-stream iso img;
61 application/octet-stream msi msp msm;
62
63 audio/midi mid midi kar;
64 audio/mpeg mp3;
65 audio/ogg ogg;
66 audio/x-m4a m4a;
67 audio/x-realaudio ra;
68
69 video/3gpp 3gpp 3gp;
70 video/mp4 mp4;
71 video/mpeg mpeg mpg;
72 video/quicktime mov;
73 video/webm webm;
74 video/x-flv flv;
75 video/x-m4v m4v;
76 video/x-mng mng;
77 video/x-ms-asf asx asf;
78 video/x-ms-wmv wmv;
79 video/x-msvideo avi;
80}
diff --git a/ymir.nix b/ymir.nix
index bf8c29fb..2df8f902 100644
--- a/ymir.nix
+++ b/ymir.nix
@@ -164,4 +164,59 @@ in {
164 ip4 = [ { address = "10.142.0.3"; prefixLength = 16; } ]; 164 ip4 = [ { address = "10.142.0.3"; prefixLength = 16; } ];
165 }; 165 };
166 }); 166 });
167
168 services.nginx = {
169 enable = true;
170 httpConfig = ''
171 include mime.types;
172 default_type application/octet-stream;
173
174 log_format main
175 '$remote_addr - $remote_user [$time_local] '
176 '"$request" $status $bytes_sent '
177 '"$http_referer" "$http_user_agent" '
178 '"$gzip_ratio"';
179
180 client_header_timeout 10m;
181 client_body_timeout 10m;
182 send_timeout 10m;
183
184 connection_pool_size 256;
185 client_header_buffer_size 1k;
186 large_client_header_buffers 4 2k;
187 request_pool_size 4k;
188
189 gzip on;
190 gzip_min_length 1100;
191 gzip_buffers 4 8k;
192 gzip_types text/plain;
193
194 output_buffers 1 32k;
195 postpone_output 1460;
196
197 sendfile on;
198 tcp_nopush on;
199 tcp_nodelay on;
200
201 keepalive_timeout 75 20;
202
203 ignore_invalid_headers on;
204
205 include hosts/*.conf;
206 '';
207 };
208 environment.etc."etc/nginx/mime.types" = {
209 source = ./custom/mime.types;
210 };
211 environment.etc."etc/nginx/hosts/dirty-haskell.conf" = {
212 text = ''
213 server {
214 listen *:80;
215 listen [::]:80;
216 server_name dirty-haskell.org www.dirty-haskell.org;
217
218 root /srv/www/dirty-haskell.org;
219 }
220 '';
221 };
167} 222}