question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect URL created when qBittorrent is behind a reverse proxy causing 404 error

See original GitHub issue

I have my qBittorrent instance on a docker network along with a reverse proxy and the Web UI is available at http://[HOST]/qBittorrent/. The API is available and works correctly, when using curl or my browser. qbittorrent-api seems to ignore the base url and so I’ve been getting 404s when trying to use the API. Here is the example code:

qbt_client = qbittorrentapi.Client(host='http://[HOST]/qBittorrent/', username='[USERNAME]', password='[PASSWORD]')

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rmartin16commented, Dec 6, 2020

hmm…even if they supported a base url, i still think this client would be broken…since it’ll always send the default paths…unless qbittorrent just accepted either i guess.

in theory, it wouldn’t be too hard to prefix the API path with any user provided base path. just a little concerned that could be a breaking change to some users if they are randomly including a path in their instantiations right now…seems pretty unlikely though.

i can at least mock something up in the next few days. thanks for letting me know.

1reaction
zachoooocommented, Dec 6, 2020

Yes my reverse proxy is trimming the prefixes. qBittorrent currently doesn’t support base urls, so I have to trim it to make it available through the reverse proxy. There is an issue open for it on qBittorrent: https://github.com/qbittorrent/qBittorrent/issues/5693

It has been open for quite some time though, so I don’t know when that feature will be added. It’s possible that this could be considered an upstream issue. Anyways here is the command:

curl http://192.168.1.69/qBittorrent/api/v2/app/version --cookie "[BROWSER COOKIE]"

I copied the cookie from my browser after logging in through the Web UI. I didn’t want to include it in case it contained any sensitive information, but the output does work.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     6  100     6    0     0   6000      0 --:--:-- --:--:-- --:--:--  6000
v4.3.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

IIS reverse proxy / url rewrite 404 errors *sometimes - Reddit
I have been trying to get reverse proxy working adequately for qBittorrent for a while. My search for a fix to this specific...
Read more >
Apache reverse proxy not working and generates a 404 error
When I curl http://localhost:8080/idp/shibboleth in the console, the instance responce is generated correctly. However when I do the same on my ...
Read more >
The "subfolder problem", OR, "why can't I reverse proxy my ...
Ultimately, to fix this issue, all links and redirects must match up to valid URLs that Caddy knows how to handle. Something's gotta...
Read more >
SWAG setup - LinuxServer.io
Reverse Proxy. A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more...
Read more >
Newest 'proxypass' Questions - Stack Overflow
how to configure nginx reverse proxy for angular app built with base href ... of through a different port, if possible, but all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found