-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx.conf
48 lines (37 loc) · 967 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
47
48
worker_processes 2;
pid /var/run/nginx.pid;
#[ debug | info | notice | warn | error | crit ]
error_log /var/log/nginx.error_log info;
events {
worker_connections 2000;
# use [ kqueue | epoll | /dev/poll | select | poll ];
}
# now we declare our main server
http {
server {
listen 80;
server_name localhost;
client_max_body_size 8M;
location /static/ {
proxy_pass http://backend_server/static/;
}
location /api/ {
proxy_pass http://backend_server/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location / {
proxy_pass http://frontend_server/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}
upstream backend_server {
server localhost:8000;
}
upstream frontend_server {
server localhost:3000;
}
}