-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.dev.conf
32 lines (24 loc) · 900 Bytes
/
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
events { }
http {
server {
listen 80;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
# Requests are directed to http://localhost:5173
proxy_pass http://web:5173;
}
# Requests starting with /api are handled
location /api {
# since this particular api does include /api in its development url (3001/api), there is no point on removing it
# by using trailing slashes, /api gets appended to server:3001.
proxy_pass http://server:3001;
}
# the inverse is true if trailing slash is used, I need to add /api/ to the proxy_pass to match the exact 3001/api url of the app
# location /api/ {
# # port and resource (api) have to match apparently exactly as the app runs on develop
# proxy_pass http://server:3001/api/;
# }
}
}