[Feature Request] Set a custom base url #247

Open
opened 2025-10-31 15:06:10 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @fREAST on GitHub (Mar 9, 2025).

I want to be able to put komodo on a custom subpath behind a reverse proxy, for example:

https://example.com/komodo

This would require all URLs be updated to prefix with the subpath, so all subsequent request from the browser are made to the correct URL.

I see the option for setting a custom webhook_base_url for the webhook, but nothing to change it for the whole application.

Originally created by @fREAST on GitHub (Mar 9, 2025). I want to be able to put komodo on a custom subpath behind a reverse proxy, for example: https://example.com/komodo This would require all URLs be updated to prefix with the subpath, so all subsequent request from the browser are made to the correct URL. I see the option for setting a custom `webhook_base_url` for the webhook, but nothing to change it for the whole application.
GiteaMirror added the enhancement label 2025-10-31 15:06:10 -05:00
Author
Owner

@wlatic commented on GitHub (Mar 12, 2025):

KOMODO_HOST=

Within your .env should do this.

I've got this running behind NPM and Pangolin

@wlatic commented on GitHub (Mar 12, 2025): KOMODO_HOST= Within your .env should do this. I've got this running behind NPM and Pangolin
Author
Owner

@fREAST commented on GitHub (Mar 12, 2025):

Hmm I actually have it set, but it does not seem to work.

KOMODO_HOST=https://example.com/komodo

Could you share your NPM/Nginx config for it?
Thanks.

@fREAST commented on GitHub (Mar 12, 2025): Hmm I actually have it set, but it does not seem to work. `KOMODO_HOST=https://example.com/komodo` Could you share your NPM/Nginx config for it? Thanks.
Author
Owner

@wlatic commented on GitHub (Mar 12, 2025):

I'd do it as a full domain as it says host:

KOMODO_HOST=https://domain.example.com

NPM points to:
http://!internal IP!:9120

NPM domain:
https://domain.example.com

@wlatic commented on GitHub (Mar 12, 2025): I'd do it as a full domain as it says host: KOMODO_HOST=https://domain.example.com NPM points to: http://!internal IP!:9120 NPM domain: https://domain.example.com
Author
Owner

@fREAST commented on GitHub (Mar 12, 2025):

Yeah this is not really what I want to do, I know I can run it on a specific domain and that works fine.
But I want to run it on a subpath, and currently there does not seem to be any way to configure that.

@fREAST commented on GitHub (Mar 12, 2025): Yeah this is not really what I want to do, I know I can run it on a specific domain and that works fine. But I want to run it on a subpath, and currently there does not seem to be any way to configure that.
Author
Owner

@adrianipopescu commented on GitHub (Apr 20, 2025):

yup, this is big for people with a ton of containers, to avoid overpopulated dns records, even if using *, it's still useful

@adrianipopescu commented on GitHub (Apr 20, 2025): yup, this is big for people with a ton of containers, to avoid overpopulated dns records, even if using *, it's still useful
Author
Owner

@mbecker20 commented on GitHub (Apr 20, 2025):

It's not easy to configure for end users because frontend is client side rendered and its own codebase. It doesn't have the server rendering html. It's not hard to do though, you would just have to build frontend yourself with the custom base path, as the one I prebuilt and package only work with the base url with no additional sub path.

@mbecker20 commented on GitHub (Apr 20, 2025): It's not easy to configure for end users because frontend is client side rendered and its own codebase. It doesn't have the server rendering html. It's not hard to do though, you would just have to build frontend yourself with the custom base path, as the one I prebuilt and package only work with the base url with no additional sub path.
Author
Owner

@adrianipopescu commented on GitHub (Apr 20, 2025):

during build I'm assuming you're populating all the router information, correct? and that remains static throughout the lifecycle of the project?

@adrianipopescu commented on GitHub (Apr 20, 2025): during build I'm assuming you're populating all the router information, correct? and that remains static throughout the lifecycle of the project?
Author
Owner

@WanderFrank commented on GitHub (Jun 3, 2025):

really need this feature

@WanderFrank commented on GitHub (Jun 3, 2025): really need this feature
Author
Owner

@Ga22be commented on GitHub (Jun 9, 2025):

I would also appreciate this feature

@Ga22be commented on GitHub (Jun 9, 2025): I would also appreciate this feature
Author
Owner

@JortRoelofs commented on GitHub (Oct 29, 2025):

I'm hoping this can still be implemented. I am aware of the difficulties that need to be overcome, so I wanted to provide an idea on how to tackle this. In the index.html, a meta tag can be created with a placeholder value for the path: <meta name="app-base" content="$$PLACEHOLDER$$">. Then, during startup of komodo either a copy of the index.html can be made where a config value (e.g. sub_path = '/komodo') is substituted, or it can be served from memory. I'm not well-versed with Rust, but looking at the tower_http documentation, I believe the map_response_body module might even be able to do this on the fly.

Then in the React SPA, a simple call with document.querySelector('meta[name="app-base"]')?.content wil receive the subpath. This can then be passed to React Router's BrowserRouter for the internal routing, and to the KomodoClient instance.

@JortRoelofs commented on GitHub (Oct 29, 2025): I'm hoping this can still be implemented. I am aware of the difficulties that need to be overcome, so I wanted to provide an idea on how to tackle this. In the index.html, a meta tag can be created with a placeholder value for the path: `<meta name="app-base" content="$$PLACEHOLDER$$">`. Then, during startup of komodo either a copy of the index.html can be made where a config value (e.g. sub_path = '/komodo') is substituted, or it can be served from memory. I'm not well-versed with Rust, but looking at the tower_http documentation, I believe the [map_response_body](https://docs.rs/tower-http/latest/tower_http/map_response_body/index.html) module might even be able to do this on the fly. Then in the React SPA, a simple call with `document.querySelector('meta[name="app-base"]')?.content` wil receive the subpath. This can then be passed to React Router's BrowserRouter for the internal routing, and to the KomodoClient instance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#247