- 前端 React+TypeScript (源码+构建产物) - 后端 Python FastAPI - 数据库迁移 001-015 - Docker部署配置 - 微信ClawBot API频道绑定 - 项目文档 README.md
27 lines
752 B
Nginx Configuration File
27 lines
752 B
Nginx Configuration File
server {
|
|
listen 8080 default_server;
|
|
server_name _;
|
|
root /app/frontend/dist;
|
|
index index.html;
|
|
|
|
# 关闭不必要日志减少容器空间占用
|
|
access_log /var/log/nginx/access.log;
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
# 前端SPA路由 - 所有非/api/路径返回index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 后端API代理
|
|
location /app/ {
|
|
proxy_pass http://localhost:18080/app/;
|
|
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;
|
|
proxy_read_timeout 60s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
}
|