Deploying to a Path Prefix
Use this guide when you want to host a service at example.com/tools instead of a dedicated subdomain.
1. Decide on routing
Traefik routes traffic based on rules. For path-based routing, combine a Host() rule with PathPrefix() (or Path() for a single path). Example target: https://example.com/tools.
2. Configure the project
Create exoframe.json like the following:
exoframe.json
{
"name": "tools-ui",
"domain": "Host(`example.com`) && PathPrefix(`/tools`)",
"labels": {
"traefik.http.middlewares.tools-strip.stripprefix.prefixes": "/tools",
"traefik.http.routers.tools.middlewares": "tools-strip"
},
"env": {
"API_BASE": "https://api.example.com"
}
}
- The
domainfield now contains the full Traefik rule. - The
stripprefixmiddleware removes/toolsbefore requests hit your service. Rename the middleware if you already have a global one. - If you want the backend to keep the prefix, skip the
labelsblock.
3. Deploy and test
exoframe deploy- Visit
https://example.com/toolsto ensure the UI loads. - Optionally confirm the middleware is applied by checking request logs - the incoming path should arrive without
/tools.
To host multiple apps under different prefixes, repeat the process with unique router and middleware names.