Route every Strapi plugin path to the CMS, not just /admin
Strapi mounts each plugin's admin API at its own top-level path (/content-manager, /upload, /i18n, ...), not nested under /admin as previously assumed. That broke the dashboard widgets: recent/count documents calls landed on the frontend instead of Strapi. List every prefix actually used by the installed plugins (core-bundled ones plus users-permissions and cloud from cms/package.json) explicitly in the Caddyfile.
This commit is contained in:
1 parent
e927396505
commit
8021ea7254
3 files changed
+26
-16
No files matched your search
+12
-5
@@ -16,11 +16,18 @@
|
||||
import security_headers
|
||||
encode zstd gzip
|
||||
|
||||
# /admin and /uploads go to Strapi; everything else to the frontend.
|
||||
# Strapi 5 nests the whole admin panel (UI + its own API) under /admin,
|
||||
# so this single prefix is enough - it never touches /api, which stays
|
||||
# reserved for the frontend's own Nitro endpoints.
|
||||
@cms path /admin* /uploads*
|
||||
# Strapi mounts each of its (and its plugins') admin APIs at its own
|
||||
# top-level path, not all under /admin - the admin panel's dashboard
|
||||
# widgets, media library, i18n, etc each call their own plugin prefix.
|
||||
# This list is every @strapi/* package in cms/package.json plus the
|
||||
# core-bundled plugins (content-manager, content-type-builder, upload,
|
||||
# i18n, email, content-releases, review-workflows). Adding a new Strapi
|
||||
# plugin later means adding its prefix here too.
|
||||
# None of this touches /api, reserved for the frontend's own Nitro
|
||||
# endpoints.
|
||||
@cms path /admin* /content-manager* /content-type-builder* /upload*\
|
||||
/i18n* /email* /content-releases* /review-workflows*\
|
||||
/users-permissions* /cloud*
|
||||
handle @cms {
|
||||
# Uploaded media can be large; Strapi's own limit still applies.
|
||||
request_body {
|
||||
|
||||
Reference in new issue
Block a user