-
Notifications
You must be signed in to change notification settings - Fork 23
/
include-server.conf
181 lines (177 loc) · 4.59 KB
/
include-server.conf
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# this file is to be included into server {} block
# create symblink [nginx_config_root]/fetch-stream-audio to point to this file's folder
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Headers "range, if-none-match" always;
add_header Access-Control-Expose-Headers "content-length" always;
add_header cache-control no-cache always;
add_header Last-Modified "" always;
##
## limit_rate controls download speed. output_buffers control audio buffer size and intentially break
## the audio decoding for certain purposes.
## technically, output_buffers controls number of iterations in ReadableStreamDefaultReader.read() JavaScript
##
location ~ ^/16kbps/ {
limit_rate 2k;
output_buffers 1 256;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/24kbps/ {
limit_rate 3k;
output_buffers 1 512;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/32kbps/ {
limit_rate 4k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/40kbps/ {
limit_rate 5k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/56kbps/ {
limit_rate 7k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/64kbps/ {
limit_rate 8k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/72kbps/ {
# 72 kbps is sufficient speed for streaming 64-kbit Opus file.
# tested with 6:42min length song of 3,515,131 bytes file that downloads in 6:31min
limit_rate 9k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/80kbps/ {
limit_rate 10k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/88kbps/ {
limit_rate 11k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/96kbps/ {
limit_rate 12k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/100kbps/ {
limit_rate 12500;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/104kbps/ {
limit_rate 13k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/112kbps/ {
limit_rate 14k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/120kbps/ {
limit_rate 15k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/128kbps/ {
limit_rate 16k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/160kbps/ {
limit_rate 20k;
output_buffers 1 2k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/192kbps/ {
limit_rate 24k;
output_buffers 1 2k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/256kbps/ {
limit_rate 32k;
output_buffers 1 2k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/384kbps/ {
limit_rate 48k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/512kbps/ {
limit_rate 64k;
output_buffers 1 1k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/768kbps/ {
limit_rate 96k;
output_buffers 1 16k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/1mbps/ {
limit_rate 125k;
output_buffers 2 8k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/1.5mbps/ {
limit_rate 188k;
output_buffers 2 8k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/2mbps/ {
limit_rate 250k;
output_buffers 2 8k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/3mbps/ {
limit_rate 375k;
output_buffers 2 16k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/4mbps/ {
limit_rate 500k;
output_buffers 2 16k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/5mbps/ {
limit_rate 625k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/6mbps/ {
limit_rate 750k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/7mbps/ {
limit_rate 875k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/8mbps/ {
limit_rate 1000k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/9mbps/ {
limit_rate 1125k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/10mbps/ {
limit_rate 1250k;
output_buffers 2 32k;
include fetch-stream-audio/include-throttle.conf;
}
location ~ ^/nolimit/ {
include fetch-stream-audio/include-throttle.conf;
}