我安装了qBittorrent docker,我在我的路由器上做了一个转发;然后是使用nginx的反向代理;最后,码头港口测绘。
锁链是:
[Port forwarding on Router]:
<WAN's IP>:44383 --> 192.168.10.254:44383
[Nginx]:
44383 --> 44373
[qBittorrent Docker]:
44373 --> 8083
Nextcloud Docker也是用同样的方法完成的,它对我很有效,但对qBittorrent失败了。
这里是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
和qbittorrent.配置文件:
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=*
下面是nginx配置文件:
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;
}
}
Docker 似乎工作正常:
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
但我无法访问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>
我用chrome浏览器得到一个空白网页。
但在Docker内部,webUI似乎还不错:
admin@pve:~/docker-qbittorrent$ docker exec -ti qbittorrent bash
root@8e7b4c80c1ea:/# curl localhost:8073
<!DOCTYPE html>
...
</html>
有人能帮忙吗?谢谢!
1条答案
按热度按时间czq61nw11#
我遇到过类似的问题,因为传入的HTTP头的来源被过滤掉了。由于某种原因,
WebUI\ServerDomains=*
配置不能正常工作。我也有WebUI\HostHeaderValidation=false
,它也不能正常工作。将
network_mode: "host"
添加到配置中并删除端口Map已修复问题。