Root & Subpath Deployment
Serve Nexus at a domain root or below a path such as /admin without broken routes and assets.
What you will learn
- Configure root routing.
- Configure a subpath build.
- Diagnose duplicate and missing paths.
Domain root
Use an empty base path for a dedicated dashboard domain such as admin.example.com.
dotenv
NEXT_BASE_PATH=
NEXT_PUBLIC_STRIP_APP_PATH=trueSubpath
Set the path without a trailing slash before starting development or creating the build.
dotenv
NEXT_BASE_PATH=/admin
NEXT_PUBLIC_STRIP_APP_PATH=trueProxy behavior
Decide whether the proxy preserves or strips the prefix, then match that behavior to Next.js basePath. Nexus expects the configured base path to remain visible to Next.js.
- HTML route works
- Next.js chunks load
- Nexus CSS loads
- Public images load
- Client navigation retains the prefix
- Direct refresh works
Common failures
404 chunks usually indicate a build/proxy base-path mismatch. A duplicated /admin/admin URL indicates the prefix was added in more than one layer. Rebuild after correcting the environment.