fix(admin): resolve Nginx redirect loop with alias and named location

Use alias to strip /admin/ prefix for file lookups and @admin_spa
named location for SPA fallback, preventing internal redirect cycle.

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
2026-06-09 09:42:58 +08:00
parent b1ef7dc6f9
commit b0062ddf39

View File

@@ -19,10 +19,15 @@ server {
} }
location /admin/ { location /admin/ {
try_files $uri $uri/ /admin/index.html; alias /usr/share/nginx/html/;
try_files $uri $uri/ @admin_spa;
} }
location / { location @admin_spa {
rewrite ^ /index.html break;
}
location = / {
return 301 /admin/; return 301 /admin/;
} }
} }