deploy: 挂目录+替换文件部署,构建产物到 deploy/,不重建 web/admin 镜像
Made-with: Cursor
This commit is contained in:
10
nginx/admin.conf
Normal file
10
nginx/admin.conf
Normal file
@@ -0,0 +1,10 @@
|
||||
# 供 compose 中 admin 容器使用:宿主机挂载 admin/dist,SPA 回退
|
||||
# 外层 Nginx 把 /admin/ 转成 / 转发到本容器
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
17
nginx/web.conf
Normal file
17
nginx/web.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
# 供 compose 中 web 容器使用:宿主机挂载 web/dist 与 verify-root,仅提供静态与 SPA 回退
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location ~ ^/([A-Za-z0-9._-]+\.(txt|html|xml))$ {
|
||||
alias /verify-root/$1;
|
||||
}
|
||||
|
||||
location = / {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user