-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
57 lines (48 loc) · 1.55 KB
/
nginx.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
worker_processes auto;
events {
worker_connections 66536;
use epoll;
multi_accept on;
}
http {
proxy_cache_path /spotify-audio-cache/cache levels=1:2 keys_zone=audio-cache:10m max_size=10g inactive=30d;
sendfile on;
tcp_nopush on;
aio on;
directio 512;
server {
listen 80;
server_name $host;
proxy_temp_path /mnt/temp;
access_log on;
error_log on;
location /audio {
resolver 8.8.8.8 ipv6=off;
proxy_pass http://$http_host$request_uri;
proxy_pass_request_headers on;
proxy_cache audio-cache;
proxy_cache_valid 200 30d;
proxy_cache_valid 404 1s;
proxy_cache_key $uri;
add_header X-Cache-Status $upstream_cache_status;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_cache_use_stale updating;
}
location /head {
resolver 8.8.8.8 ipv6=off;
proxy_pass http://$http_host$request_uri;
proxy_pass_request_headers on;
proxy_cache audio-cache;
proxy_cache_valid 200 30d;
proxy_cache_valid 404 1s;
proxy_cache_key $uri;
add_header X-Cache-Status $upstream_cache_status;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_cache_use_stale updating;
}
}
}