...
前后端服务器部署成功后,需要配置nginx,对前后端的请求进行分发。
注意:nginx的匹配规则是从上到下的,所以以下规则顺序不能颠倒。
代码块 | ||
---|---|---|
| ||
upstream smartbi-static { server 10.10.204.101:18080; } upstream smartbi-dynamic { server 10.10.204.100:18080; } server { listen 8088; server_name 10.10.204.150; location = /smartbi/vision/gbk.jsp { proxy_pass http://smartbi-static; } location ~ /smartbi/app/.* { proxy_pass http://smartbi-static; } location ~ /smartbi/vision/ssreport/htmls/.* { proxy_pass http://smartbi-dynamic; } location ~ /smartbi/vision/officehtmls/.* { proxy_pass http://smartbi-dynamic; } location ~ /smartbi/vision/.*(\.bmp|\.css|\.cur|\.db|\.eot|\.gif|\.GIF|\.htm|\.html|\.ico|\.jpg|\.JPG|\.js|\.json|\.map|\.otf|\.patch|\.png|\.PNG|\.svg|\.swf|\.template|\.ts|\.ttf|\.ttfx|\.txt|\.woff|\.woff2|\.xls|\.xml|\.yml)$ { proxy_pass http://smartbi-static; } location ~ /smartbi/smartbix/min/.* { proxy_pass http://smartbi-static; } location ~ /smartbi/smartbix/static/.* { proxy_pass http://smartbi-static; } location ~ /smartbi/.* { proxy_pass http://smartbi-dynamic; } } |
...