Merge pull request #390 from fastapiadmin/dev

fix: 修正前端部署基础路径与Nginx代理配置
This commit is contained in:
fastapiadmin
2026-05-12 18:48:23 +08:00
committed by GitHub
3 changed files with 4 additions and 10 deletions
+2 -7
View File
@@ -67,12 +67,6 @@ http {
# 连接数限制: 每 IP 最多 100 个并发连接 # 连接数限制: 每 IP 最多 100 个并发连接
limit_conn_zone $binary_remote_addr zone=conn_limit:10m; limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
# ==================== Upstream 配置 ====================
upstream backend_upstream {
server backend:8001;
keepalive 32;
}
# ==================== HTTP -> HTTPS 重定向 ==================== # ==================== HTTP -> HTTPS 重定向 ====================
server { server {
listen 80; listen 80;
@@ -154,7 +148,8 @@ http {
limit_req zone=api_limit burst=20 nodelay; limit_req zone=api_limit burst=20 nodelay;
limit_conn conn_limit 100; limit_conn conn_limit 100;
proxy_pass http://backend_upstream; # 后端服务器地址
proxy_pass http://backend:8001;
# WebSocket 支持 # WebSocket 支持
proxy_http_version 1.1; proxy_http_version 1.1;
+1 -2
View File
@@ -15,8 +15,7 @@ import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: './', base: '/app',
// base: "/app",
optimizeDeps: { optimizeDeps: {
exclude: process.env.NODE_ENV === 'development' ? ['wot-design-uni', 'uni-echarts'] : [], exclude: process.env.NODE_ENV === 'development' ? ['wot-design-uni', 'uni-echarts'] : [],
}, },
+1 -1
View File
@@ -7,7 +7,7 @@ VITE_VERSION = 3.0.2
VITE_PORT = 5180 VITE_PORT = 5180
# 应用部署基础路径(如部署在子目录 /admin,则设置为 /admin/) # 应用部署基础路径(如部署在子目录 /admin,则设置为 /admin/)
VITE_BASE_URL = / VITE_BASE_URL = /web
# 权限模式【 frontend 仅前端路由 / backend 仅后端菜单 / mixed 后端菜单+前端路由模块合并 】 # 权限模式【 frontend 仅前端路由 / backend 仅后端菜单 / mixed 后端菜单+前端路由模块合并 】
VITE_ACCESS_MODE = mixed VITE_ACCESS_MODE = mixed