Serve the CMS admin panel under /admin on the public domain
Replace the separate CMS subdomain with path-based routing in Caddy: /admin and /uploads go to Strapi, everything else to the frontend. Strapi 5 nests its whole admin panel (UI and API) under /admin, so this one prefix is enough and never collides with the frontend's own /api routes. Drops CMS_DOMAIN and the unused STRAPI_URL env var on the cms service; PUBLIC_STRAPI_URL now points at the same origin as the site. Authentication is unchanged: Strapi's own admin login still gates the panel, this only changes how it's reached.
This commit is contained in:
+2
-2
@@ -2,7 +2,6 @@
|
||||
|
||||
# --- Domains (Caddy) ---
|
||||
PUBLIC_DOMAIN=blog.localhost
|
||||
CMS_DOMAIN=cms.blog.localhost
|
||||
ACME_EMAIL=admin@example.com
|
||||
|
||||
# --- Database ---
|
||||
@@ -25,4 +24,5 @@ STRAPI_URL=http://cms:1337
|
||||
# Public base URL of the website, used for canonical URLs and Open Graph.
|
||||
PUBLIC_SITE_URL=https://blog.localhost
|
||||
# Public base URL of Strapi, used to build absolute media URLs in the browser.
|
||||
PUBLIC_STRAPI_URL=https://cms.blog.localhost
|
||||
# Same origin as PUBLIC_SITE_URL: Caddy proxies /admin and /uploads to Strapi.
|
||||
PUBLIC_STRAPI_URL=https://blog.localhost
|
||||
|
||||
Reference in New Issue
Block a user