-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuring WebUI URL base path #21471
base: master
Are you sure you want to change the base?
Conversation
bf342fb
to
b07bc4f
Compare
From what I can tell from the code, using your current examples, setting "URL base path" to You probably want to add some sanity checks if you really want to push this through, but unless a proxy doesn't support rewrites this might be unnecessary (see my comment here). If you do push forward, you may want to use the |
Thanks for the feedback. There's already a sanity check to ensure the path ends with a trailing slash. Good call on the leading slash - I'll add a check for that. The reason I'm not using the |
3a65cad
to
0c1f2a8
Compare
0c1f2a8
to
af1bfbe
Compare
71cea6b
to
3e6db0d
Compare
@qbittorrent/bug-handlers Can someone please review this? It has been open for over a month. There are merge conflicts but the general approach will remain the same. |
There is one concern from me but I'm not sure it is fully related. I haven't evaluated thoroughly. Also, another related question: is nginx able to inject base url in the requests on its own (without any help from qbt side)? Is it problematic to do so? |
I think it's a valid concern, however users seem to really want this feature. I think the best option would be to allow users to configure this but also make it clear (maybe in the wiki) that this approach is suboptimal and that using a unique (sub)domain is preferable.
I'm not certain. In #5693 it seems that some users are using nginx's |
The cache now persists more than just translations.
This provides the underlying support for having a configurable base path. Future commit(s) will expose this functionality to users.
This applies to all scripts, css, images, and WebAPI requests.
3e6db0d
to
c68971a
Compare
This PR adds support for configuring the URL base path used to access the WebUI. This makes it easier to use qBittorrent behind a reverse proxy with a custom path (e.g.
https://example.com/qbit/
).The WebUI previously relied heavily on relative paths. For example, api requests were made to
api/v2/...
and scripts were loaded fromscripts/lib/...
(note the lack of a leading/
). Now, the WebUI exclusively makes use of absolute paths, defaulting to a base path of/
. These means that, by default, these resources will be loaded from/api/v2/...
and/scripts/lib...
, respectively. An empty base path can no longer be set - if attempting to do so, it will use/
.Closes #5693.