forked from kekloldyormarket/Mango-Money-Multiplier
-
Notifications
You must be signed in to change notification settings - Fork 5
/
nginx.conf
46 lines (37 loc) · 999 Bytes
/
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
error_log /dev/stdout info;
events {}
http {
# https://github.com/jetbrains-infra/docker-nginx-resolver
include /etc/nginx/includes/resolver.conf;
# https://www.nginx.com/blog/websocket-nginx/
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream rest-api {
server mango-service-v3:3000;
}
upstream ws-api {
server mango-bowl:8005;
}
server {
access_log /dev/stdout;
listen 80;
# https://localhost/api
location /api/ {
set $backend_api "http://rest-api/api/";
if ($request_uri ~* "/api/(.*$)") {
set $path_remainder $1;
}
proxy_pass $backend_api$path_remainder;
}
# ws://localhost/ws
location /ws {
proxy_pass http://ws-api/v1/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
}