-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.template.conf
89 lines (73 loc) · 2.01 KB
/
nginx.template.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
upstream periodo_server {
server $UPSTREAM_HOST fail_timeout=0;
}
map $upstream_status $no_cache {
500 1;
503 1;
default 0;
}
# caching configuration
proxy_cache_path
# path to cache dir
/mnt/cache
# 2 directory levels, 1st is 1 char, 2nd is 2 chars
levels=1:2
# put temporary files in the cache dir
use_temp_path=off
# name and size of the shared memory zone where keys are stored
keys_zone=periodo_proxy_cache:10m
# time after which unrequested files are purged
inactive=1y
# maximum cache size before least recently requested files are purged
max_size=2G;
server {
listen 8080;
listen [::]:8080;
charset utf-8;
# If the request body is larger than 8K,
# it is written to a temporary file
client_body_temp_path "/tmp" 1 2;
client_max_body_size 1G;
gzip on;
gzip_vary on;
include mime.types;
types {
application/rdf+xml rdf;
text/turtle ttl;
}
location = /d.ttl {
return 301 https://$http_host/dataset.ttl;
}
location = /d.csv {
return 301 https://$http_host/dataset.csv;
}
location = /v.ttl {
alias /srv/www/vocab.ttl;
}
location = /vocabulary.ttl {
alias /srv/www/vocab.ttl;
}
location = /v.ttl.html {
alias /srv/www/vocab.html;
}
location = /vocabulary.ttl.html {
alias /srv/www/vocab.html;
}
location = /highlight-style.css {
alias /srv/www/highlight-style.css;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_cache periodo_proxy_cache;
proxy_cache_key $request_uri;
proxy_cache_methods GET HEAD;
proxy_cache_revalidate on;
proxy_no_cache $no_cache;
add_header X-Cache-Status $upstream_cache_status;
proxy_redirect off;
proxy_pass http://periodo_server;
proxy_read_timeout 600s;
}
}