Skip to content

[Kubernetes Deployment] Configure Web Base Path via Environment Variable #3302

Description

@McFredward

What problem are you trying to solve?

When Open Design is deployed behind a reverse proxy or ingress under a sub-path like /opendesign, the application still generates some URLs as if it were hosted at /. This causes broken navigation, asset loading, and plugin preview requests unless the app is served from the root path.
We need a supported way to configure the web base path for example through an environment variable, like OD_WEB_BASE_PATH=/opendesign.

Why this is needed

  • Community-Clusters in my company share the same base URL, so it's impossible to deploy directly on /. Changing it to a subpath is a requirement for me.
  • Some routes, assets, and preview/plugin URLs currently miss the base path prefix
  • This leads to broken reloads, wrong browser URLs, and missing assets in production deployments

Describe the solution you'd like

What should change

  • Introduce one official env var for the web base path, e.g. OD_WEB_BASE_PATH
  • Ensure all browser-visible routes respect that base path
  • Ensure all frontend-generated asset URLs respect that base path
  • Ensure all browser-side /api/... calls respect that base path
  • Ensure plugin preview/example HTML and related asset URLs also work correctly behind the configured base path
  • Document the variable for Docker/Kubernetes deployments

Acceptance criteria

  • With OD_WEB_BASE_PATH=/opendesign, the app works fully under /opendesign
  • Browser navigation uses /opendesign/...
  • Refreshing deep links works
  • Static assets load from /opendesign/...
  • Browser API calls go to /opendesign/api/...
  • Plugin preview/example assets also load correctly behind the same prefix

I have already started changing most places, so the basic functionality of OpenDesign is now working under a subpath—just so you can see a possible way to implement this (not final):

https://github.com/nexu-io/open-design/compare/release/v0.8.0...McFredward:open-design:feature/base-path-full?expand=1

Alternatives you've considered

There are no alternatives I'm aware of—just path-rewrite in the ingress is not enough, since all API calls in the web application are using the base path.

Additional context

No response

Would you be willing to contribute a PR?

Yes, with guidance from a maintainer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions