Loading... 如果你必须通过域名或外网 IP 访问,你需要告诉 Nginx 不要对 qBit 的路径进行身份验证。 1. 使用 root 权限编辑 qBit 的 Nginx 配置文件 ```bash vim /etc/nginx/apps/qbittorrent.conf ``` 2. **修改后的内容应如下所示**(假设你的 swizzin 用户名是 `master`,请替换为你的实际用户名): ``` location /qbt { return 301 /qbittorrent/; } location /qbittorrent/ { # 【修改点 1】将 $remote_user 替换为你实际的用户名 (例如 admin) proxy_pass http://master.qbittorrent; proxy_http_version 1.1; proxy_set_header X-Forwarded-Host $http_host; http2_push_preload on; # 【修改点 2】注释掉下面这两行验证 # auth_basic "What's the password?"; # auth_basic_user_file /etc/htpasswd; rewrite ^/qbittorrent/(.*) /$1 break; proxy_cookie_path / "/qbittorrent/; Secure"; # ... 其余保持不变 ... } ``` 3. 保存退出。 4. 测试并重启 Nginx: ```bash sudo nginx -t sudo systemctl reload nginx ``` **结果:** 现在访问 `你的域名/qbittorrent` 时,将不再弹出第一个窗口,直接进入 qBit 的登录界面,Vertex 也能正常访问了。 ### 在 qBittorrent 中关闭 CSRF 保护(可选) Vertex 在通过反向代理连接 qBit 时,有时会因为 **CSRF(跨站请求伪造)** 保护而被拦截。 1. 登录你的 qBittorrent WebUI。 2. 点击 **工具 (Tools)** -> **选项 (Options)** -> **Web UI**。 3. 找到并 **取消勾选** “启用跨站请求伪造(CSRF)保护” (Enable Cross-site request forgery (CSRF) protection)。 4. 点击最下方的 **保存 (Save)**。 最后修改:2025 年 12 月 26 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏