forked from avalonmediasystem/avalon-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcache.conf
More file actions
64 lines (53 loc) · 1.99 KB
/
Copy pathcache.conf
File metadata and controls
64 lines (53 loc) · 1.99 KB
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
proxy_cache_path /etc/nginx/cache levels=1:2 keys_zone=thumb_cache:8m max_size=10g inactive=60m use_temp_path=off;
proxy_cache_valid 200 30m;
proxy_cache_key $host$uri$is_args$args;
server {
listen 80 default_server;
client_max_body_size 250M;
# The IP of a hard-coded server name in a 'proxy_pass' directive is resolved
# only when Nginx starts, but the IP (or IPs) of Docker containers may change
# when Docker redeploys or scales them. Putting a server's name in a variable
# causes Nginx to resolve it dynamically.
resolver 127.0.0.11 valid=2s ipv6=off;
set $avalon_backend avalon;
# location ~ /master_files/(?<mfid>.+)/thumbnail {
# add_header X-Cached $upstream_cache_status;
# proxy_ignore_headers "Set-Cookie";
# proxy_hide_header "Set-Cookie";
# proxy_ignore_headers Cache-Control;
#
# proxy_cache thumb_cache;
# proxy_pass http://$avalon_backend:3000/master_files/$mfid/thumbnail;
# }
#
# location ~ /master_files/(?<mfid>.+)/poster {
# add_header X-Cached $upstream_cache_status;
# proxy_ignore_headers "Set-Cookie";
# proxy_hide_header "Set-Cookie";
# proxy_ignore_headers Cache-Control;
#
# proxy_cache thumb_cache;
# proxy_pass http://$avalon_backend:3000/master_files/$mfid/poster;
# }
location /assets {
add_header X-Cached $upstream_cache_status;
proxy_cache thumb_cache;
proxy_pass http://$avalon_backend:3000$uri;
}
location /packs {
add_header X-debug-message "trying to cache" always;
add_header X-Cached $upstream_cache_status;
proxy_cache thumb_cache;
proxy_pass http://$avalon_backend:3000$uri;
}
location / {
proxy_pass http://$avalon_backend:3000;
proxy_read_timeout 30m; # Default: 60s.
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on; # Optional
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
}