forked from pig-mesh/pig-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pig-ui.conf
34 lines (30 loc) · 985 Bytes
/
pig-ui.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
server {
listen 80;
server_name localhost;
gzip on;
gzip_static on; # 需要http_gzip_static_module 模块
gzip_min_length 1k;
gzip_comp_level 4;
gzip_proxied any;
gzip_types text/plain text/xml text/css;
gzip_vary on;
gzip_http_version 1.0; #兼容多层nginx 反代
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# 打包好的dist目录文件,放置到这个目录下
root /data/;
# 注意维护新增微服务,gateway 路由前缀
location ~* ^/(code|auth|admin|gen) {
proxy_pass http://pig-gateway:9999;
#proxy_set_header Host $http_host;
proxy_connect_timeout 15s;
proxy_send_timeout 15s;
proxy_read_timeout 15s;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 避免端点安全问题
if ($request_uri ~ "/actuator"){
return 403;
}
}