-
-
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
Configuration for WebUI base url for use in reverse proxy #5693
Comments
This comment has been minimized.
This comment has been minimized.
Since this is pretty much the only result that comes up when searching for reverse proxy support in QBittorrent, here's a workaround that I'm using and appears to work fine.
|
The above configuration worked for me. The only issue was that when navigating to the URL (ex. domain.com/qbt) Nginx would return a 404 error, but when a trailing slash was added (ex. domain.com/qbt/) it would work fine. I ended up just configuring a redirect to the trailing slash URL.
|
Would love to see a base URL, or root folder option added for reverse proxy. |
Both @sruon and @MichaelHub workarounds work, but when I select "Peers" tab it shows empty list and displays something like "qbittorrent client inaccessible". However using direct connection via ip:port works fine. |
@asc7uni Oh, I hadn't used the WebUI before setting it up and thought it was just flakey like that. I'll take a look at my configuration this week and see if I can find a fix. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This looks like a popular request, tagging @Chocobo1 if he's interested. |
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
As stated in the original feature request:
|
Another +1 for this, not working for me behind Nginx. Login screen appears (without any images strangely) then when I submit the password appears in the URL and goes to blank screen :| |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
I've put a bounty on this. I'd like something that works with Apache. |
I'd like to see this added too... I'm running everything inside Docker containers, so my nginx reverse proxy configuration would look like this:
I'm using Unfortunately the Having qbittorrent operate out of a webroot such as |
The reason the proxying fails for me is because the Web UI is internally sending requests to the host without using the base URL. Just for the record, this would be how it's done in lighttpd, in case someone wants to use that instead of nginx:
But of course it has the same issue. |
Adds a base path configuration option to the WebUI. WebApplication injects base path into content paths on initial configuration. Requires a restart to update. Internally, the path is stripped from the request to maintain the existing api/file structure. Requests without the path trigger a 303 redirect response. Closes qbittorrent#5693
Adds a base path configuration option to the WebUI. WebApplication injects base path into content paths on initial configuration. Requires a restart to update. Internally, the path is stripped from the request to maintain the existing api/file structure. Requests without the path trigger a 303 redirect response. Closes qbittorrent#5693
I'm sorry, maybe I'm off topic and don't understand something... but I am sure that Proxies should not require any additional worries on the part of the services behind them.
Maybe that's really the problem? |
At present, all the client-side references point to the root directory. You're able to load the first page, but none of the dependencies load because they don't include whatever path you've configured your reverse proxy to use. Edit: In the changes I've made, I'm prepending all the resource URLs in the client-side code with a static path including the configured base path. This forces everything to point to the right place without having to worry about the URL being correct for relative paths. |
I think we can fix this trailing / issue, but we'll need more info on it, it isn't clear how/where we should handle this.
I suppose qbt could add a workaround for this (duplicate /) IF this is a separate issue of the aforementioned one. |
The simplest way without a configurable base path would probably be a js snippet in the index page to redirect the page if it's missing the trailing /.
On second thoughts a duplicate / isn't really an issue for qbt, it's up to the user to configure their reverse proxy correctly. (And would only be caused if they hadn't done so) I'll throw together a branch that redirects the page with a trailing / if missing and do a bit of testing to see if everything works correctly. |
I run SABnzbd, whose URL ends with a trailing slash, and that has no issues. Proxies handle trailing slashes on URLs just fine. Double forward slash in a URL would be an issue though. Nginx would need a non-default module installing to perform a string replacement (https://github.com/yaoweibin/ngx_http_substitutions_filter_module) of "//" to "/". That's going to cause issues with any legitimate uses of double forward slashes though... e.g. https://mydomain.com, for example, would become https:/mydomain.com. |
Closes qbittorrent#5693 Index pages now automatically redirect to a path with a trailing "/". If the site was accessed through a proxy with a modified path, a missing trailing "/" would break the relative paths.
What's left to do here ? |
I think there's still an issue with the CSS and JS not loading correctly when using a different base URL. In my case, using the method from this comment, I could load all the HTML correctly, but the rest didn't load at all. Part of it could be fixed by adding a |
Is there any plan to have a Base URL configuration, like in raddar, sonarr and the like? I use Caddy as a reverse proxy |
I've found the solution for NGINX defined in the wiki doesn't completely work for me. Some API requests - such as getting the content list for an individual torrent - do not work. The NGINX solution specified in linuxserver's reverse proxy configs works completley for me - I haven't run into any issues with the following conf:
Note the |
I don't suppose there's any way around the CSS/JS issue without a base url being implemented? Does anyone know if there's an alternative frontend which might have base url support? |
I have a draft PR up (#21471) that implements this feature and would like some feedback. Ideally, folks can test my branch and verify it adequately satisfies their use case. This is working well with my test nginx setup (nginx config included below), but you may have a different setup that this does not work for. If so, let me know. Note the trailing slash in both the server {
listen 80;
server_name example.com;
location /qbit/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
}
} |
Hey folks. Sorry to barge in on your 8 year old discussion, but I thought I'd bring some insight as someone who has worked with websites and services for almost 18 years. I'm sorry if I missed some important details, its a pretty long thread. While silly compared to OSes, the web has a fairly strict requirement to know the difference between a "directory" and an "endpoint". In the file system, there's typically a directory mime type available for the system to extrapolate from and know that As such, while there is nothing technically in the standards regarding directories, the consensus is that with a slash means a directory and without means an endpoint, aka resource or file. That means a trailing slash is a requirement when you're trying to do something like map an internal service from
So, if you intend to resolve Other resources on the subject: Google Search Console, URL rewriting (StackOverflow; see top two answers for details) Happy to answer any questions. |
This issue seems to be getting quite some thumbs up's from people who would like to see this added
Please, to keep the mailboxes of everyone clean, do not +1 this as a comment, but rather click the thumbs up icon beneath this very first message.
For the people landing here from Google:
A workaround can be found here: https://github.com/qbittorrent/qBittorrent/wiki/NGINX-Reverse-Proxy-for-Web-UI
I have searched for this and it appears to not be possible as of yet.
It would be really useful if there is an option to specify the base URL path for use in reverse proxies. This way one can circumvent having to type the port number into the URL.
For instance, when the qBittorent web UI is running on port
8080
, and the base url is set to/qbt
. Then the complete URL would become127.0.0.1:8080/qbt
. One can then use, per example, nginx to reverse proxy this to a more friendly url like so:Thus allowing one to goto
jt.REDACTED.net/qbt
and land on the qBittorrent page.There is a $50 open bounty on this issue. Add to the bounty at Bountysource.
DISCLAIMER: There are trustworthiness and solvency issues with BountySource. qBittorrent is not affiliated with them. Use them at your own risk.
The text was updated successfully, but these errors were encountered: