mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-31 20:19:35 +08:00
feat(deploy): 添加 nginx 反向代理配置并优化前端构建流程
- 新增 nginx 配置模板,用于前端服务的反向代理 - 更新 Dockerfile,使用 pnpm 替代 npm 并添加 nginx 配置 - 添加启动脚本,实现后端健康检查和动态配置 nginx - 更新 .env.example,为后端主机添加注释说明 - 优化 docker-compose.yml,明确版本号并调整服务依赖
This commit is contained in:
18
BillNote_frontend/deploy/default.conf.template
Normal file
18
BillNote_frontend/deploy/default.conf.template
Normal file
@@ -0,0 +1,18 @@
|
||||
server {
|
||||
listen 80;
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://backend:${BACKEND_PORT};
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user