-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.conf
More file actions
63 lines (53 loc) · 1.64 KB
/
nginx.conf
File metadata and controls
63 lines (53 loc) · 1.64 KB
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
master_process off;
daemon off;
error_log stderr;
events {
worker_connections 128;
}
http {
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log /dev/stderr;
sendfile on;
keepalive_timeout 65;
gzip off;
root ./static/;
upstream app {
server 127.0.0.1:3001;
}
upstream webpack {
server 127.0.0.1:3002;
}
server {
listen 3000;
error_log stderr;
location ~ ^/((js|css|img|favicon.ico)/?(.*)) {
error_log /dev/stderr;
proxy_pass http://webpack/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^(.*?\.hot-update\.js.*)$ {
error_log /dev/stderr;
proxy_pass http://webpack/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/(socket\.io.*) {
error_log /dev/stderr;
proxy_pass http://webpack/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ ^/(.*) {
error_log /dev/stderr;
proxy_pass http://app/$1$is_args$args;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}