-
Notifications
You must be signed in to change notification settings - Fork 90
/
nginx.conf.template
108 lines (86 loc) · 2.27 KB
/
nginx.conf.template
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
daemon off;
worker_processes 4;
events {
worker_connections 1024;
}
http {
upstream stf_app {
server __IP_ADDRESS__:3100 max_fails=0;
}
upstream stf_auth {
server __IP_ADDRESS__:3200 max_fails=0;
}
upstream stf_storage_apk {
server __IP_ADDRESS__:3300 max_fails=0;
}
upstream stf_storage_image {
server __IP_ADDRESS__:3400 max_fails=0;
}
upstream stf_storage {
server __IP_ADDRESS__:3500 max_fails=0;
}
upstream stf_websocket {
server __IP_ADDRESS__:3600 max_fails=0;
}
upstream stf_api {
server __IP_ADDRESS__:3700 max_fails=0;
}
types {
application/javascript js;
image/gif gif;
image/jpeg jpg;
text/css css;
text/html html;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name stf.test;
keepalive_timeout 70;
root /dev/null;
resolver 127.0.0.1 valid=300s;
resolver_timeout 10s;
# Handle [email protected]
location ~ "^/d/floor4/([^/]+)/(?<port>[0-9]{5})/$" {
proxy_pass http://__IP_ADDRESS__:$port/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}
location /auth/ {
proxy_pass http://stf_auth/auth/;
}
location /s/image/ {
proxy_pass http://stf_storage_image;
}
location /s/apk/ {
proxy_pass http://stf_storage_apk;
}
location /s/ {
client_max_body_size 10240m;
client_body_buffer_size 128k;
proxy_pass http://stf_storage;
}
location /socket.io/ {
proxy_pass http://stf_websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $http_x_real_ip;
}
location /api/ {
proxy_pass http://stf_api/api/;
}
location / {
proxy_pass http://stf_app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $http_x_real_ip;
}
}
}