修改文件配置

This commit is contained in:
wuweihua
2026-09-24 11:23:14 +08:00
parent 252e177495
commit f602060ab4
62 changed files with 2583 additions and 3506 deletions
+42
View File
@@ -0,0 +1,42 @@
# BMS 前端 Nginx 配置(容器内)
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_min_length 1k;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
# 后端接口反代:/prod-api/xxx -> backend:8080/xxx(backend 为 compose 服务名)
location /prod-api/ {
proxy_pass http://backend:8080/;
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 60s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
client_max_body_size 20m;
}
# 上传文件/头像
location /profile/ {
proxy_pass http://backend:8080/profile/;
proxy_set_header Host $host;
}
# 禁止外网访问 Druid
location /druid/ {
deny all;
return 404;
}
# Vue Router history 回退
location / {
try_files $uri $uri/ /index.html;
}
}