项目初始化

This commit is contained in:
Stev_Wang
2025-12-22 23:51:21 +08:00
commit 4a97b964ac
64 changed files with 8371 additions and 0 deletions

43
frontend/nginx.conf Normal file
View File

@@ -0,0 +1,43 @@
server {
listen 80;
server_name localhost;
# 配置静态资源服务
location / {
root /usr/share/nginx/html;
index index.html;
# 处理前端路由SPA模式
try_files $uri $uri/ /index.html;
}
# 配置API反向代理到后端服务
location /api/ {
proxy_pass http://backend:3000/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;
# 增加超时配置
proxy_connect_timeout 5s;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
# 配置游戏API代理如果需要
location /game-api/ {
proxy_pass http://backend:3000/game-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;
# 增加超时配置
proxy_connect_timeout 5s;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
# 配置404页面
error_page 404 /index.html;
}