-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
84 lines (64 loc) · 2.52 KB
/
nginx.conf
File metadata and controls
84 lines (64 loc) · 2.52 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
worker_processes auto;
events {
worker_connections 768;
# multi_accept on;
}
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_cache:10m inactive=60m;
proxy_cache_key "$scheme$request_method$host$request_uri";
proxy_cache_valid 200 60m;
add_header Cache-Status $upstream_cache_status;
map $imgtype $origin_file {
default desktop.jpg;
desktopImg desktop.jpg;
titleImg titleImg.png;
small small.png;
}
server {
listen 8080;
location /live/ {
resolver 8.8.8.8;
proxy_ssl_server_name on;
proxy_set_header Host live.hub.netdb.at;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://live.hub.netdb.at/;
}
location ~ ^/avatar/([0-9]+)$ {
resolver 8.8.8.8;
set $user_id $1;
proxy_ssl_server_name on;
proxy_set_header Host api.login.netdb.at;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://api.login.netdb.at/publicuser/$user_id/avatar;
}
location ~ ^/hub_images/(?<id>[A-Za-z0-9_-]+)/(?<imgtype>[A-Za-z0-9_-]+)/(?<w>\d+)x(?<h>\d+)\.(jpg|png)$ {
resolver 8.8.8.8;
set $sig "internal";
set $src "https://image.hub.netdb.at/$id/$origin_file";
proxy_ssl_server_name on;
proxy_set_header Host imageproxy.netdb.at;
proxy_hide_header Set-Cookie;
proxy_pass https://imageproxy.netdb.at/$sig/rs:fit:$w:$h/plain/$src;
}
location ~ ^/hub_images/(?<id>\d+)/(?<file>[^/]+)$ {
resolver 8.8.8.8;
set $sig "internal";
set $src "https://image.hub.netdb.at/$id/$file";
proxy_ssl_server_name on;
proxy_set_header Host imageproxy.netdb.at;
proxy_pass https://imageproxy.netdb.at/$sig/plain/$src;
}
location /data/ {
proxy_pass https://netdbhub.blob.core.windows.net;
proxy_set_header X-Real-IP $remote_addr;
proxy_hide_header Access-Control-Allow-Origin;
proxy_cache static_cache;
proxy_cache_bypass $http_pragma;
proxy_cache_revalidate on;
}
}
}