Newer
Older
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
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
load_module modules/ngx_http_perl_module.so;
env GROUPID;
env PORT_PREFIX;
events {
worker_connections 1024;
}
http {
perl_set $GROUPID 'sub { return $ENV{"GROUPID"}; }';
perl_set $PORT_PREFIX 'sub { return $ENV{"PORT_PREFIX"}; }';
client_max_body_size 100M;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://10.${GROUPID}.0.5:3000;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
location /api/ {
proxy_pass http://10.${GROUPID}.0.4:8000;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
location /api/root/ {
proxy_pass http://10.${GROUPID}.0.4:8000/;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
location /admin/ {
proxy_pass http://10.${GROUPID}.0.4:8000;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
location /static/ {
proxy_pass http://10.${GROUPID}.0.4:8000;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
location /media/ {
proxy_pass http://10.${GROUPID}.0.4:8000;
proxy_http_version 1.1;
proxy_set_header Host $host:${PORT_PREFIX}${GROUPID};
}
}
}