Allow customizing the default '_nicegui' path #5081
Closed
godsdarling
started this conversation in
Ideas / Feature Requests
Replies: 2 comments 2 replies
-
https://github.com/zauberzeug/nicegui/tree/main/examples/nginx_subpath I believe this is what you’re looking for. Have a look at the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Note that "/_nicegui" isn't reserved for static assets but all routes that are used by NiceGUI internally. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Currently, NiceGUI serves its static files under the fixed path /_nicegui.
This works fine in local development, but in some deployment environments (e.g. behind reverse proxies, Ingress, or CI/CD pipelines), static files must be placed under a specific path in order to be correctly loaded.
For example, in our CI/CD deployment, all assets must be served under /api/{namespace}/abtest/nicegui/ instead of the root path. With the current implementation, we have to rely on external rewrites (e.g. via Nginx) to make it work, which adds extra complexity.
Problem
The static path is hardcoded as /_nicegui and cannot be changed.
This makes deployment in real production environments less flexible.
Workarounds like rewrite rules in Nginx are possible but not ideal.
Feature Request
Please provide an option to customize the static path. For example:
or via environment variable:
export NICEGUI_STATIC_PATH=/api/{namespace}/abtest/nicegui
Expected Outcome
Users can configure where NiceGUI serves its static files, instead of always being forced to use the default /_nicegui.
This would make CI/CD deployment much smoother and reduce the need for external rewrites.
Beta Was this translation helpful? Give feedback.
All reactions