-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
40 lines (30 loc) · 1010 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
daemon off;
pid tmp/nginx.pid;
error_log /dev/stderr info;
events {
}
http {
access_log /dev/stdout;
server {
listen 8000;
server_name localhost;
location / {
# when django returns a 404, we proxy to webpack-dev-server
error_page 404 = @webpack;
# try to proxy to django by default
proxy_pass http://localhost:8001/;
proxy_intercept_errors on;
# convince django that we're really running on the correct host/port combo
# this makes django-rest-framework show the correct urls in HyperlinkedModelSerializers
proxy_set_header Host $http_host;
# so we can identify where responses are coming from in Chrome Dev Tools
add_header X-Proxied-For django;
}
# all other urls are proxied to webpack-dev-server running on port 3000
location @webpack {
proxy_pass http://localhost:8002;
# so we can identify where responses are coming from in Chrome Dev Tools
add_header X-Proxied-For webpack;
}
}
}