关于樱花frp配置的问题,本地有个django测试项目,用gunicorn127.0.0.1:8000和nginx127.0.0.1都正常访问,在sakurafrp建立隧道以后访问提供的地址就出现Bad Request
Contradictory scheme headers
隧道内打开了自动https,如果不打开就提示501错误,不让传输http,打开就出现这个错误,该怎么办呢?应该是nginx配置问题?我把代码附上。
```bash
server {
listen 80;
server_name www.u3305268.nyat.app:28078;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; # 关键配置
proxy_set_header X-Forwarded-Host $server_name;
}
location /static/ {
alias /home/sanky/code/something_use/grades_project/grades_project/stat>
}
}
这个问题怎么解决?服务器端的日志正常“ Tunnel/changshaTCP 隧道启动成功
Tunnel/changsha使用 >>www.u3305268.nyat.app:28078<< 连接你的隧道
Tunnel/changsha为提升使用体验, 请避免使用节点 IP 直连
2026/01/30 15:32:10ITunnel/changsha[85/3305268/fd6f] 隧道启动成功
2026/01/30 15:48:21ITunnel/changshafrpc 已退出
2026/01/30 15:48:23ITunnel/changsha开始加载隧道配置
2026/01/30 15:48:23ITunnel/changshafrpc version: 0.51.0-sakura-12.3 (built: 2025-08-18 22:30)
2026/01/30 15:48:23ITunnel/changsha正在连接节点 [www.u3305268.nyat.app, tcp]
2026/01/30 15:48:23ITunnel/changsha[85/3305268/fd6f] 连接节点成功, 运行 ID [3305268-fd6fe3a6]
2026/01/30 15:48:23ITunnel/changsha[85/3305268/fd6f] 隧道启动中: [changsha, tcp]
2026/01/30 15:48:23ITunnel/changsha[85/3305268/fd6f] 限速已更新: 10 Mibit/s
2026/01/30 15:48:23ITunnel/changsha已从服务器为 www.u3305268.nyat.app 加载证书 [CN = *.u3305268.nyat.app, 2026-01-29 - 2026-04-29]
Tunnel/changshaTCP 隧道启动成功
Tunnel/changsha使用 >>www.u3305268.nyat.app:28078<< 连接你的隧道
Tunnel/changsha为提升使用体验, 请避免使用节点 IP 直连
2026/01/30 15:48:23ITunnel/changsha[85/3305268/fd6f] 隧道启动成功
```