mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #1162] feat: relative path support #51033
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hahchenchen on GitHub (Mar 14, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1162
Bug Report
webui docker images do not support relative path.
Description
for xample, i want to start webui at localhost:8080/webui/, does the image parameter support the relative path configuration?
@hahchenchen commented on GitHub (Mar 14, 2024):
@tjbck
@blackshot commented on GitHub (Mar 14, 2024):
i'm facing the same issue, i can't deploy it behind a reverse proxy under specific path only because static files doesn't have the path prefix

@CyberIngeniero commented on GitHub (Mar 14, 2024):
I also have the same problem.
@tjbck commented on GitHub (Mar 14, 2024):
If not officially supported, but I can see that being useful for a lot of people. Feel free to make a PR!
@justinh-rahb commented on GitHub (Mar 14, 2024):
This can be accomplished through reverse-proxy and request rewrite rules as well.
@blackshot commented on GitHub (Mar 14, 2024):
nope, i deployed it behind a reverse proxy but static files needs to be compiled with basepath too
@blackshot commented on GitHub (Mar 15, 2024):
https://kit.svelte.dev/docs/configuration#paths
@hahchenchen commented on GitHub (Mar 15, 2024):
no, the proxy is not useful. the static files path is hard code.
@hass-demacia commented on GitHub (Mar 25, 2024):
Use caddy2, Caddyfile config
It seems browser can fetch javascript static files, but get a runtime error:
@behackl commented on GitHub (Apr 23, 2024):
I've successfully deployed an instance behind a reverse proxy from a subdirectory using the branch attached to #1701. I wouldn't say that I am particularly happy with the way how I solved it, but perhaps this is useful to whoever decides to work on a proper implementation. 😄
@lmorin-inria commented on GitHub (May 9, 2024):
The feature was critical for me. I have implemented it there:
https://github.com/lmorin-inria/open-webui/tree/feat/base-path-relocatable
The path is set dynamically when launching the container (variable). I will had a documentation if there are people asking for it.
The MR was rejected. I will keep that fork up to date from time to time with only that feature for the next few weeks at least.
@TomlDev commented on GitHub (May 28, 2024):
I am interested @lmorin-inria!
I tried with our nginx proxy and this config where I rewrite the URL and use sub_filters to rewrite all paths:
It is able to rewrite most of the calls, but not all as it seems:

@lmorin-inria commented on GitHub (May 28, 2024):
You are welcome.
The container I propose does not need any rewriting. That's the point, Sveltes uses a single page design template, and does not support URL rewriting. I fix this by configuring at runtime the "path" location.
However I can see that in your configuration you try to rewrite the path. You should not probably.
=> When you launch the container, set the "ROOT_PATH" :
docker (...) -e ROOT_PATH= (...)
In you case your might use that syntax :
docker (...) -e ROOT_PATH=ai (...)
And the web server will serve the frontend pages in
http://10.0.0.3:8080/ai/app
The backend answer to
http://10.0.0.3:8080/ai/
@massih10 commented on GitHub (Jun 14, 2024):
Can you push the image/container to docker hub? I'm unable to build it myself.
@massih10 commented on GitHub (Jun 20, 2024):
got it working! thank you :)
@lmorin-inria commented on GitHub (Jun 20, 2024):
Dear Sir,
I am very sorry I could not help you on the way, I am really overloaded.
I am preparing a new merge by the way (version 3.x).
Regards,
Best regards,
L. Morin.
Le 20/06/2024 à 13:48, Sayed Hoseini a écrit :
@guidocioni commented on GitHub (Aug 6, 2024):
Hey @lmorin-inria I tried to use your image but unfortunately it does not seem to work..
The login page is correctly loaded but I can already see that the
/staticpath (not a big deal) and the/socket.iopath (big deal) are not correctly passed/foundIf I try to signin I get a
not founderror on the pathhttps://<base_path>/<ROOT_PATH>/api/v1/auths/signin.I feel like I'm missing something on the nginx subpath directive, and I see you haven't shared that in your issue. I'm using something like this
@natohutch commented on GitHub (Aug 7, 2024):
Hi all, this is something that would be useful for me so keen to see this move forward. I also see there've been attempts with #2148 and #1701. I'm happy to provide a little bit of help if its needed to push this across the line.
@hsmallbone commented on GitHub (Oct 1, 2024):
Was in a similar boat to @lmorin-inria (requirement to run in slurm) so have made a similar patch to main as of today. Unlikely to be merged and only sporadically updated by myself.
https://github.com/hsmallbone/open-webui/tree/relative-urls
@usrdmn commented on GitHub (Oct 3, 2024):
Well, I may be kinda stupid, but it was unsuccessful attempt to build image from your fork, and have access by path. If you can kindly give me a hint what Im doing wrong it will be very appreciated.
My docker-compose.yaml is bellow:
@hsmallbone commented on GitHub (Oct 4, 2024):
The webapp is mounted at ${ROOT_PATH}/app so the path would be /ai/app
@usrdmn commented on GitHub (Oct 4, 2024):
Thank you very much mister. You are legend!
@lmorin-inria commented on GitHub (Oct 6, 2024):
Sorry for being away for such a long time.
Please find a new update. I did not push the version 0.3.21 earlier because I was facing some small bugs
It shall be better with this 0.3.30 version (same branch)
Note that I changed my method this time, avoiding any renaming. It shall help me to keep track of future changes with less efforts.
@hahchenchen commented on GitHub (Oct 7, 2024):
how to set the config?
@lmorin-inria commented on GitHub (Oct 7, 2024):
It is a fork validated using the generation of an OCI container (i.e. Docker). You can deploy as explained in the regular documentation. It shall work. But if you want to change the PATH of the URL, set the ROOT_PATH environment variable.
Typically for Podman or Docker, that would be "-e ROOT_PATH=" in the run command line.
@hahchenchen commented on GitHub (Oct 8, 2024):
dont need config the nginx?
@lmorin-inria commented on GitHub (Oct 9, 2024):
Sorry, that's another issue ! I do not provide a machine/cluster configuration. By the way, I use HaProxy in a more complex cluster infrastructure that goes beyond the usage of that container.
However, many web software support path relocation as a parameter, that feature is quite common. Nothing special about that one. Many proxy configurations shall work with that container.
@frdidonato commented on GitHub (Oct 21, 2024):
This is an essential change for my production environment, and it works like a charm! please let's make sure this feature is integrated into the main project!
@lmorin-inria commented on GitHub (Oct 23, 2024):
The changes required to accept the feature would also require a strong update of all svelte developers : they put absolute paths in the source code... Not something I would let one of my student do. But I also appreciate all the work shared by this great project. I cannot complain.
@EvanLin1704 commented on GitHub (Nov 13, 2024):
Can you support setting the rootpath to multiple levels?
My attempts to use the following configuration failed
ROOT_PATH=project01/job1/aiURL: http://192.168.1.100:8080/project01/job1/aiWhen she jumps to http://192.168.1.100:8080/project01/job1/ai/app
You will see a lot of following errors in developer options
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.@lmorin-inria commented on GitHub (Nov 13, 2024):
Indeed, it's a bug. It was supposed to work, but I reproduced it. Sorry about that.
I will try to fix it for my next update (~end of November).
@canytam-krystal commented on GitHub (Dec 6, 2024):
I install the docker image and run it. I can see the login page and login but there is nothing shown after login. How to fix it?
@tjbck commented on GitHub (Dec 21, 2024):
Relative path support is not something we intend to officially support at this time. The primary reasons are straightforward: I do not have the capacity to introduce additional complexities to the project right now, and no one has bothered to submit an atomic pull request that aligns with the contribution guidelines. On top of this, there are more pressing bug fixes and priority tasks that require attention, so I won’t be dedicating time to this feature for the foreseeable future.
While I acknowledge that relative path support might be helpful for a subset of users, it’s simply not a current priority. If this feature is important to you, I strongly encourage you to fork the project and maintain your own version. This is the beauty of open source—nothing is stopping you from taking ownership of the changes you care about.