-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzxinfo.dk.conf
85 lines (73 loc) · 1.79 KB
/
zxinfo.dk.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
server {
## gzip config
gzip on;
gzip_min_length 1000;
gzip_comp_level 5;
gzip_proxied any;
gzip_vary on;
gzip_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/json
application/xml
application/rss+xml
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;
server_name zxinfo.dk;
access_log /var/log/nginx/zxinfo.log combined2;
# limit_req zone=one burst=10;
# if facebook - rewrite to /social service
set $social 0;
if ($http_user_agent ~* "facebookexternalhit|SkypeUriPreview") {
set $social 1;
}
if ($request_uri ~ "media") {
set $social 0;
}
if ($social = 1) {
rewrite ^/(.*)$ /social/$1 break;
}
# main pass to docker container with ZXInfo app
location / {
expires 1h;
add_header Pragma public;
add_header Cache-Control "public";
proxy_cache sinclair_cache;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8200/;
}
# SOCIAL - Facebook metadata generator
location = /social {
return 302 /social/;
}
location /social/ {
proxy_pass http://v3.zxinfo.dk/v3/;
proxy_set_header Host v3.zxinfo.dk;
}
# MEDIA files
location /media {
return 302 /media/;
}
location /media/ {
add_header Access-Control-Allow-Origin *;
expires 1y;
root /www/sinclair/;
}
# to be deleted
location /usage/ {
root /var/www/;
}
# covers/upload
location /covers/ {
# set client body size to 2M #
client_max_body_size 2M;
proxy_pass http://127.0.0.1:3000;
}
}