feat: 添加前端 Docker 打包支持
This commit is contained in:
parent
67a1308abf
commit
717f97f020
|
|
@ -1,2 +1,3 @@
|
|||
# API 地址配置
|
||||
VITE_API_BASE_URL=https://app.zpc-xy.com/corps/api/api/admin
|
||||
# 使用 Nginx 代理,直接用相对路径
|
||||
VITE_API_BASE_URL=/api
|
||||
|
|
|
|||
|
|
@ -10,6 +10,15 @@ server {
|
|||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# API 代理
|
||||
location /api/ {
|
||||
proxy_pass http://corps-admin-api:8080;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# 缓存静态资源
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
expires 1y;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user