blob: 2d8c84394f50f3a12c425c269ab8d93c8b040a10 [file] [log] [blame]
server {
listen 3004;
server_name _; # 允许所有域名访问
# 静态资源处理
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
# 反向代理API请求到后端
location /api/ {
proxy_pass http://team4.10813352.xyz:5004; # 代理路径与后端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;
}
}