fix: admin nginx 容器路由(dist 在根路径,/admin/ 前缀 rewrite)

This commit is contained in:
2026-09-13 00:31:41 +08:00
parent 4f8dd8be75
commit b72ec4e5a2
+6 -3
View File
@@ -3,11 +3,14 @@ server {
server_name _;
root /usr/share/nginx/html;
index index.html;
location = / { return 302 /admin/; }
location /admin/ {
try_files $uri $uri/ /admin/index.html;
rewrite ^/admin/(.*)$ /$1 last;
}
location / {
try_files $uri $uri/ /index.html;
}
location = /admin { return 301 /admin/; }
location = / { return 301 /admin/; }
location ~* \.(js|css|png|jpg|svg|woff2?)$ {
expires 30d;
add_header Cache-Control "public, immutable";