Can't access qbittorrent docker webui

I installed qBittorrent docker. I made a forwarding on my router; then a reverse proxy using nginx; And finally, docker ports mapping.

The chains was:

[Port forwarding on Router]:
<WAN's IP>:44383 --> 192.168.10.254:44383   
[Nginx]:
44383 --> 44373
[qBittorrent Docker]:
44373 --> 8083

Nextcloud docker was done in the same way, and It worked for me. But it failed for qBittorrent.

Here was the docker-compose.yml:

admin@pve:~/docker-qbittorrent$ cat docker-compose.yml
version: "2"
services:
  qbittorrent:
    image: linuxserver/qbittorrent
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - UMASK_SET=022
      - WEBUI_PORT=8073
      #- WEBUI_PORT=8080
      #- DOMAIN=https://example.com

    volumes:
      - ./config:/config
      - ./downloads:/downloads
    ports:
      - "6881:6881/tcp"
      - "6881:6881/udp"
      - "44373:8073"
      #- "44373:8080"
    restart: unless-stopped

And qbittorrent.conf:

admin@pve:~/docker-qbittorrent$ cat config/qBittorrent/qBittorrent.conf
[AutoRun]
enabled=false
program=

[LegalNotice]
Accepted=true

[Network]
Cookies=@Invalid()

[Preferences]
Connection\PortRangeMin=6881
Connection\UPnP=false
Downloads\SavePath=/downloads/
Downloads\ScanDirsV2=@Variant(\0\0\0\x1c\0\0\0\0)
Downloads\TempPath=/downloads/incomplete/
WebUI\Address=*
WebUI\Port=8073
WebUI\ServerDomains=*

Here was the nginx config file:

admin@pve:/etc/nginx/sites-available$ cat ../sites-enabled/docker-qbittorrent
server {
  listen 8083;
  server_name example.com;
#  return 301 https://$host$request_uri;
}
server {
#    listen 44383 ssl http2;
    listen 44383;
    server_name example.com;
    ssl on;
    ssl_certificate /etc/ssl/certs/example.com.pem;
    ssl_certificate_key /etc/ssl/certs/example.com.key;
    location / {
        proxy_redirect off;
        proxy_pass http://127.0.0.1:44373;
        proxy_set_header Host $http_host;
    }
}

The docker seemed work fine:

admin@pve:~/docker-qbittorrent$ docker ps
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                 PORTS                                                                               NAMES
8e7b4c80c1ea        linuxserver/qbittorrent    "/init"                  3 hours ago         Up 3 hours             0.0.0.0:6881->6881/tcp, 0.0.0.0:6881->6881/udp, 8080/tcp, 0.0.0.0:44373->8073/tcp   qbittorrent

But I could not get visit the webUI:

admin@pve:~/docker-qbittorrent$ curl localhost:6881
curl: (52) Empty reply from server
admin@pve:~/docker-qbittorrent$ curl localhost:44373
<No output here>
admin@pve:~/docker-qbittorrent$ curl https://example.com:44383
<No output here>

I got a blank webpage using the chrome browser.

But inside the the docker, the webUI seemed OK:

admin@pve:~/docker-qbittorrent$ docker exec -ti qbittorrent bash
root@8e7b4c80c1ea:/# curl localhost:8073
<!DOCTYPE html>
...
</html>

Could any one can help? Thanks!

You need to use the same port on both sides of the container due to the CSRF issue explained in the readme.

1 Like

Thank you. It worked after changing to the same ports.