Skip to content

Commit 1ea8e6e

Browse files
committed
add nginx sample conf
1 parent 759e24a commit 1ea8e6e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
gzip on;
6+
gzip_min_length 1024;
7+
gzip_buffers 4 8k;
8+
gzip_types text/css application/x-javascript application/json;
9+
10+
sendfile on;
11+
12+
location ^~ /static/ {
13+
root /path/to/ws-with-koa;
14+
}
15+
16+
location ^~ /ws/ {
17+
proxy_pass http://127.0.0.1:3000;
18+
proxy_http_version 1.1;
19+
proxy_set_header Upgrade $http_upgrade;
20+
proxy_set_header Connection "upgrade";
21+
}
22+
23+
location / {
24+
proxy_pass http://127.0.0.1:3000;
25+
proxy_set_header X-Real-IP $remote_addr;
26+
proxy_set_header Host $host;
27+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
28+
}
29+
}

0 commit comments

Comments
 (0)