Getting Unauthorized Error with qBittorrent Behind Nginx Proxy Manager

I’m running into a frustrating problem with my qBittorrent setup. I have Nginx Proxy Manager (NPM) working perfectly for my other services, each with their own subdomain. Recently I deployed qBittorrent with gluetun in Docker to route traffic through my Mullvad VPN connection.

The torrent client works fine when I access it directly via the host IP and port. But when I try to access it through NPM using a subdomain, I keep getting an “Unauthorized” error message. I’ve configured NPM to point to the correct internal IP and port, tried both with and without SSL enforcement using my Let’s Encrypt wildcard certificate. Both qBittorrent and NPM are set to use HTTP protocol.

I’ve enabled the reverse proxy option in qBittorrent settings and added my network subnets to the configuration, but the issue persists. Most guides I found online discuss custom path setups rather than subdomain configurations, and other users seem to have subdomain setups working without issues. I feel like I’m missing something obvious in the qBittorrent configuration but can’t figure out what it is.

I struggled with this too! Double check the NPM config for any typos and ensure you’re using the same port as in qBittorrent. Sometimes it helps to clear your cache or try from a different browser. Good luck!

Check qBittorrent’s Web UI settings - make sure “Alternative Web UI” isn’t causing conflicts. I had the same auth issues when mine pointed to an old vuetorrent install. Also check NPM’s access list settings since they can mess with auth headers. The “Bypass authentication for clients on localhost” setting tripped me up too. If NPM forwards from a different subnet while this is on, auth gets wonky. Try turning off qBittorrent auth completely first to see if it’s an auth problem or routing issue. If it works without auth, your proxy setup’s fine and you can focus on fixing the auth config.

Had this exact issue last month. Your problem’s in qBittorrent’s web UI settings - look for “Use UPnP/NAT-PMP port forwarding from my router.” You need to completely disable “Enable Host header validation” when running behind a reverse proxy. This setting blocks requests that don’t match the expected host header, which is exactly what happens when NPM forwards your subdomain requests. Also make sure your “Server domains” field includes your subdomain or just leave it blank. Restart the qBittorrent container after these changes and it’ll work right away. Just checking the reverse proxy box won’t cut it - you’ve got to fix the host header validation thing.