You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
625 B
27 lines
625 B
# 在 server { } 内、location / 之前或之后按需 include。
|
|
# root 须指向 Laravel 的 public 目录。
|
|
|
|
# 后台静态资源
|
|
location ^~ /admin/assets/ {
|
|
try_files $uri =404;
|
|
access_log off;
|
|
expires 7d;
|
|
}
|
|
|
|
# 后台入口:仅 /admin 与 /admin/ 返回 index.html
|
|
location = /admin {
|
|
return 302 /admin/;
|
|
}
|
|
|
|
location ^~ /admin/ {
|
|
try_files $uri $uri/ @admin_spa;
|
|
}
|
|
|
|
location @admin_spa {
|
|
# 深链 /admin/courses 等 → Hash 路由(与 AdminSpaController 一致)
|
|
if ($uri ~ "^/admin/(.+)$") {
|
|
return 302 /admin/#/$1$is_args$args;
|
|
}
|
|
try_files /admin/index.html =404;
|
|
}
|