安装qBittorrent
apt-get install qbittorrent-nox -y
开机启动
nano /etc/systemd/system/qbittorrent-nox.service
插入以下内容
[Unit]
Description=qBittorrent-nox
After=network.target
[Service]
User=root
Type=forking
RemainAfterExit=yes
ExecStart=/usr/bin/qbittorrent-nox -d
[Install]
WantedBy=multi-user.target
相关命令:
# 修改qbittorrent-nox.service文件后重新载入
systemctl daemon-reload
#启动
systemctl start qbittorrent-nox
#停止
systemctl stop qbittorrent-nox
#设置开机启动
systemctl enable qbittorrent-nox
#查看状态
systemctl status qbittorrent-nox
默认账号:admin
密码:adminadmin
默认登陆网址:ip:8080
nginx反代
nano /etc/nginx/conf.d/default.conf
插入一下内容
location /qb/ {
proxy_pass http://127.0.0.1:8080/; #端口按照实际配置修改
proxy_hide_header Content-Security-Policy;
proxy_http_version 1.1;
add_header Front-End-Https on;
proxy_set_header X-Forwarded-Host $server_name:$server_port;
proxy_hide_header Referer;
proxy_hide_header Origin;
}
重启nginx服务
systemctl restart nginx
在qb中“选项”-“web 用户界面”-“验证”
中取消“启用跨站点请求伪造(CSRF)保护”
否则会出现页面显示错误
此时就可以通过 https://xxx.xxxx.com/qb/
来访问qb