Files
BMS/deploy/nginx-front.conf
T
2026-09-24 11:23:14 +08:00

43 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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;
}
}