From fe7c7e014600e7680bbc13a5183e70c9e34493d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Mon, 26 Jan 2026 13:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9WVP=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/wvp/web/conf/nginx.conf | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docker/wvp/web/conf/nginx.conf b/docker/wvp/web/conf/nginx.conf index fe25844..b64309d 100644 --- a/docker/wvp/web/conf/nginx.conf +++ b/docker/wvp/web/conf/nginx.conf @@ -14,20 +14,7 @@ http { listen 80; server_name localhost; - location / { - root /home/ruoyi/projects/wvp-ui; - try_files $uri $uri/ /index.html; - index index.html index.htm; - } - - # 前端静态资源(CSS、JS、图片等) - location /static/ { - root /home/ruoyi/projects/wvp-ui; - expires 30d; - access_log off; - } - - # WVP 后端 API 代理 + # WVP 后端 API 代理(优先匹配) location /api/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; @@ -55,6 +42,20 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + # 前端静态资源(CSS、JS、图片等) + location /static/ { + root /home/ruoyi/projects/wvp-ui; + expires 30d; + access_log off; + } + + # 前端页面(最后匹配) + location / { + root /home/ruoyi/projects/wvp-ui; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + # 避免actuator暴露 if ($uri ~ "/actuator") { return 403;