summaryrefslogtreecommitdiff
path: root/nginx.conf
blob: 097c64df793ab134159747f0933c36a20cab36bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
events {
  use epoll;
}

pid /dev/null;
error_log /dev/null;

http {

  include nginx.gen.conf;

  access_log /dev/null;
  error_log stderr info;
  client_body_temp_path /dev/null;

  types {
    application/font-woff woff;
    application/javascript js;
    application/json json;
    application/x-font-ttf ttf;
    audio/mp4 m4a;
    "audio/ogg; codecs=vorbis" ogg;
    "audio/ogg; codecs=opus" opus;
    audio/wave wav;
    image/jpeg jpg;
    image/png png;
    image/svg+xml svg;
    image/webp webp;
    text/cache-manifest appcache;
    text/css css;
    "text/html; charset=utf-8" html;
    video/mp4 mp4;
    video/ogg ogv;
    video/webm webm;
    video/x-matroska mkv;
  }
  default_type application/octet-stream;

  gzip on;
  gzip_types application/javascript application/json image/svg+xml text/plain text/css;
  gzip_vary on;

  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;

  index index.html;

  server {
    listen 8080;
    root www;
    add_header Cache-Control public;
    location /dump/ {
      expires 1y;
      location ~ ^/dump/(bgm|sfx)/ { add_header X-Content-Duration "0"; }
    }

    location ~ ^/(css/font|js/lib|scripts)/ {
      expires 1d;
    }

    location / {
      if ($http_cookie !~ "warned") {
        return 301 /warn.html;
      }
    }

    location /setcookie.html {
      add_header Set-Cookie "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly";
      return 301 /;
    }

    location /warn.html {
      break;
    }

    expires 5s;
    add_header X-UA-Compatible "IE=edge";
  }
}
# vim:ft=nginx: