-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.conf
More file actions
35 lines (29 loc) · 1.17 KB
/
Copy pathdefault.conf
File metadata and controls
35 lines (29 loc) · 1.17 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
server {
listen 80 default_server;
server_name _; # 修改为自定义的访问域名
client_max_body_size 100m;
add_header X-Frame-Options SAMEORIGIN always;
root /var/www/build/;
try_files $uri /index.html;
gzip on;
gzip_buffers 4 8k;
gzip_min_length 1k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png application/x-font-ttf font/ttf;
gzip_disable "MSIE [1-6]\.";
location ^~ /api/ {
rewrite ^/api(.*) $1 break;
proxy_pass http://127.0.0.1:9001;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~ /api/ws/ {
rewrite ^/api(.*) $1 break;
proxy_pass http://127.0.0.1:9002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}