fix: admin 容器 nginx 去掉静态正则 location(与 alias 冲突致 404)

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