-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
74 lines (57 loc) · 2.29 KB
/
default.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
server {
listen 80;
server_name localhost;
root /usr/share/nginx/dist;
index index.html;
#是否启动 gzip 压缩,on 代表启动,off 代表开启
gzip on;
#需要压缩的常见静态资源
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
#由于 nginx 的压缩发生在浏览器端而微软的 ie6 很坑爹,会导致压缩后图片看不见所以该选
#项是禁止 ie6 发生压缩
gzip_disable "MSIE [1-6]\.";
#如果文件大于 1k 就启动压缩
gzip_min_length 1k;
#以 16k 为单位,按照原始数据的大小以 4 倍的方式申请内存空间,一般此项不要修改
gzip_buffers 4 16k;
#压缩的等级,数字选择范围是 1-9,数字越小压缩的速度越快,消耗 cpu 就越大
gzip_comp_level 2;
client_max_body_size 20m;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://medical-backend:8080/api;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
client_max_body_size 20m;
}
location /prod-api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://newtouch.com/prod-api;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
client_max_body_size 20m;
}
location / {
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
}