mirror of
https://github.com/lintsinghua/DeepAudit.git
synced 2026-09-24 23:23:44 +08:00
- 后端使用 uv 管理依赖,镜像内包含所有依赖 - 前端使用生产构建 + serve 提供静态文件 - 添加 WeasyPrint 完整系统依赖 - 修复 PDF 报告 Logo 显示问题 - 添加 .dockerignore 优化构建 - 更新部署文档和 GitHub Actions 工作流 - 前端端口从 5173 改为 3000
27 lines
682 B
Nginx Configuration File
27 lines
682 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# 处理 SPA 路由
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 代理 API 请求到后端
|
|
location /api/ {
|
|
proxy_pass http://backend:8000/api/;
|
|
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)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|