-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx-dev.conf
68 lines (60 loc) · 1.79 KB
/
nginx-dev.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# server for main domain
server {
# proxy 80 to 3000
listen 80;
server_name localhost;
location / {
proxy_pass http://app-server:3000;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
location /_next/webpack-hmr {
proxy_pass http://app-server:3000/_next/webpack-hmr;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
# remove api/socket from path
location /api/socket {
proxy_pass http://websocket-server:3001;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
}
# server for subdomains
server {
# proxy 80 to 3000
listen 80;
server_name *.localhost;
location / {
proxy_pass http://app-server:3000;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
location /_next/webpack-hmr {
proxy_pass http://app-server:3000/_next/webpack-hmr;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
# remove api/socket from path
location /api/socket {
proxy_pass http://websocket-server:3001;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
}
}