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:
@@ -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/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user