deploy(v2): h5 build with base /v2/h5, admin dockerfile & nginx route, shared compose
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# v2 部署本地化:这个 nginx 容器只负责把 /v2/admin/ 下的 SPA 静态文件吐出去
|
||||
# 对外分流由现网 deploy-admin-1 的 nginx 完成(/v2/admin/ 原样透传、/v2-api/ 转发到 v2 api)
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
client_max_body_size 10m;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location = /v2 {
|
||||
return 301 /v2/admin/;
|
||||
}
|
||||
|
||||
location /v2/admin/ {
|
||||
try_files $uri $uri/ /v2/admin/index.html;
|
||||
}
|
||||
|
||||
# v2 版 H5(构建时 router.base 必须为 /v2/h5/,产物放 /usr/share/nginx/html/v2/h5)
|
||||
location = /v2/h5 {
|
||||
return 301 /v2/h5/;
|
||||
}
|
||||
|
||||
location = /v2/h5/index.html {
|
||||
add_header Cache-Control "no-cache";
|
||||
}
|
||||
|
||||
location /v2/h5/ {
|
||||
try_files $uri $uri/ /v2/h5/index.html;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user