mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-11 18:10:06 +08:00
feat(deploy): 重构部署方案并添加 nginx 代理
- 新增 nginx 服务作为前端和后端的代理 - 重新配置前端和后端服务,不再直接暴露端口 - 更新前端 Dockerfile,简化为静态文件服务器- 在 MarkdownViewer 组件中添加 ExternalLink 图标
This commit is contained in:
21
nginx/default.conf
Normal file
21
nginx/default.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# 所有非 /api 请求全部代理给 frontend 容器
|
||||
location / {
|
||||
proxy_pass http://frontend:80;
|
||||
}
|
||||
|
||||
# 所有 /api 请求代理给 backend 容器
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
proxy_pass http://backend:8000/static/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user