-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
54 lines (48 loc) · 1.56 KB
/
nginx.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
worker_processes 4;
events { worker_connections 1024; }
http {
upstream node-app {
least_conn;
server auth:5000 weight=10 max_fails=3 fail_timeout=30s;
server ecommerce:7000 weight=10 max_fails=3 fail_timeout=30s;
server oms:8000 weight=10 max_fails=3 fail_timeout=30s;
}
server {
listen 8080;
location / {
proxy_pass http://node-app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ ^/auth {
rewrite ^/auth/(.*) /$1 break;
proxy_pass http://auth:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ ^/ecommerce {
rewrite ^/ecommerce/(.*) /$1 break;
proxy_pass http://ecommerce:7000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ ^/oms {
rewrite ^/oms/(.*) /$1 break;
proxy_pass http://oms:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}