首选修改frpc.ini配置
添加一行
proxy_protocol_version = v2
每个需要的隧道都要添加
[xxxxxxxxxxxxx] # 备注:-xxxxxxx privilege_mode = true type = http local_ip = 127.0.0.1 local_port = 80 custom_domains = bangshun.com use_encryption = true use_compression = true proxy_protocol_version = v2
修改网站的配置文件,替换或者添加如下内容
server{ listen 80 proxy_protocol; listen 443 ssl proxy_protocol; set_real_ip_from 111.111.111.111;#frp服务端ip set_real_ip_from 127.0.0.1; real_ip_header proxy_protocol; real_ip_recursive on; 省 略 后 面 一 大 堆 }
重启一下frpc和nginx试试吧
本文创建于:2023年03月21日,最后更新于:2023年03月21日,已超过 772 天没更新!内容可能已失效,请自行测试,失效请评论区反馈,谢谢啦~