This commit is contained in:
2026-01-11 15:19:11 +08:00
parent 7750808f25
commit 90999332b8
2 changed files with 16 additions and 33 deletions

View File

@@ -1,3 +1,7 @@
# 此文件已废弃
# 前端容器已整合到 coin-exchange-new/docker-compose.yml 中
# 请使用后端的 docker-compose.yml 进行部署
version: '3.8' version: '3.8'
services: services:

View File

@@ -5,39 +5,6 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
# API 反向代理到后端网关
location /admin/ {
proxy_pass http://coin-gateway-server:8080/admin/;
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;
}
location /user/ {
proxy_pass http://coin-gateway-server:8080/user/;
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;
}
location /finance/ {
proxy_pass http://coin-gateway-server:8080/finance/;
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;
}
location /exchange/ {
proxy_pass http://coin-gateway-server:8080/exchange/;
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;
}
# 处理 Vue Router 的历史模式 # 处理 Vue Router 的历史模式
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
@@ -60,3 +27,15 @@ server {
gzip_types text/plain text/css application/json application/javascript text/xml application/xml; gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
gzip_min_length 1024; gzip_min_length 1024;
} }
# 禁用缓存 index.html
location = /index.html {
expires -1;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Gzip 压缩
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
gzip_min_length 1024;
}