summaryrefslogtreecommitdiff
path: root/lighttpd.conf
blob: 8c0699e7b2c549e0f125b0f107e26187f611a074 (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
82
server.document-root = var.CWD + "/www"
server.port = 8080

mimetype.assign = (
  ".appcache" => "text/cache-manifest",
  ".css" => "text/css",
  ".html" => "text/html; charset=utf-8",
  ".jpg" => "image/jpeg",
  ".js" => "application/javascript",
  ".json" => "application/json",
  ".mkv" => "video/x-matroska",
  ".mp4" => "video/mp4",
  ".ogg" => "audio/ogg",
  ".png" => "image/png",
  ".svg" => "image/svg+xml",
  ".ttf" => "application/x-font-ttf",
  ".txt" => "text/plain; charset=utf-8",
  ".webm" => "video/webm",
  ".webp" => "image/webp",
  ".woff" => "application/font-woff"
)

index-file.names = ("index.html")

dir-listing.activate = "enable"

server.modules = ( "mod_expire", "mod_compress", "mod_setenv" )

expire.url = ("/dump/" => "access plus 1 years",
              "/css/font/" => "access plus 7 days",
              "/js/lib/" => "access plus 1 days",
              "/scripts/" => "access plus 1 days",
              "/" => "access plus 5 seconds")
setenv.add-response-header += (
    "Cache-Control" => "public"
)

compress.cache-dir = "/tmp/lighttpd-compress"
compress.filetype = ("text/html", "text/plain", "text/css", "application/javascript", "application/json")

# I hate Firefox.
$HTTP["url"] =~ ".ogg$" { setenv.add-response-header += ( "X-Content-Duration" => "0" ) }
$HTTP["url"] == "/dump/bgm/Afternoon.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "176" ) }
$HTTP["url"] == "/dump/bgm/Ah_Eh_I_Oh_You.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "126" ) }
$HTTP["url"] == "/dump/bgm/Air_Guitar.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "73" ) }
$HTTP["url"] == "/dump/bgm/Aria_de_l'Etoile.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "83" ) }
$HTTP["url"] == "/dump/bgm/Breathlessly.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "113" ) }
$HTTP["url"] == "/dump/bgm/Caged_Heart.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "81" ) }
$HTTP["url"] == "/dump/bgm/Cold_Iron.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "182" ) }
$HTTP["url"] == "/dump/bgm/Comfort.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "158" ) }
$HTTP["url"] == "/dump/bgm/Concord.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "185" ) }
$HTTP["url"] == "/dump/bgm/Daylight.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "106" ) }
$HTTP["url"] == "/dump/bgm/Ease.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "148" ) }
$HTTP["url"] == "/dump/bgm/Everyday_Fantasy.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "112" ) }
$HTTP["url"] == "/dump/bgm/Friendship.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "76" ) }
$HTTP["url"] == "/dump/bgm/Fripperies.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "88" ) }
$HTTP["url"] == "/dump/bgm/Generic_Happy_Music.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "77" ) }
$HTTP["url"] == "/dump/bgm/High_Tension.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "53" ) }
$HTTP["url"] == "/dump/bgm/Hokabi.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "142" ) }
$HTTP["url"] == "/dump/bgm/Innocence.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "193" ) }
$HTTP["url"] == "/dump/bgm/Letting_my_Heart_Speak.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "156" ) }
$HTTP["url"] == "/dump/bgm/Lullaby_of_Open_Eyes.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "189" ) }
$HTTP["url"] == "/dump/bgm/Moment_of_Decision.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "243" ) }
$HTTP["url"] == "/dump/bgm/Nocturne.low.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "229" ) }
$HTTP["url"] == "/dump/bgm/Nocturne.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "229" ) }
$HTTP["url"] == "/dump/bgm/Out_of_the_Loop.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "145" ) }
$HTTP["url"] == "/dump/bgm/Painful_History.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "160" ) }
$HTTP["url"] == "/dump/bgm/Parity.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "129" ) }
$HTTP["url"] == "/dump/bgm/Passing_of_Time.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "48" ) }
$HTTP["url"] == "/dump/bgm/Raindrops_and_Puddles.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "155" ) }
$HTTP["url"] == "/dump/bgm/Red_Velvet.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "208" ) }
$HTTP["url"] == "/dump/bgm/Romance_in_Andante_II.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "176" ) }
$HTTP["url"] == "/dump/bgm/Romance_in_Andante.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "64" ) }
$HTTP["url"] == "/dump/bgm/Sarabande_from_BWV1010,_Musicbox.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "82" ) }
$HTTP["url"] == "/dump/bgm/School_Days.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "168" ) }
$HTTP["url"] == "/dump/bgm/Shadow_of_the_Truth.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "130" ) }
$HTTP["url"] == "/dump/bgm/Standing_Tall.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "177" ) }
$HTTP["url"] == "/dump/bgm/Stride.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "134" ) }
$HTTP["url"] == "/dump/bgm/The_Student_Council.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "103" ) }
$HTTP["url"] == "/dump/bgm/To_Become_One.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "248" ) }
$HTTP["url"] == "/dump/bgm/Wiosna.ogg" { setenv.add-response-header += ( "X-Content-Duration" => "70" ) }
# TODO: Add /dump/sfx content duration