mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2181] frps是否可以接收 PROXY protocol? #1739
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1739
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @renkx on GitHub (Jan 10, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2181
我是nginx sni第四层分流到frps的,nginx设置了proxy_protocol on(启用PROXY protocol发送),frps能否接收PROXY protocol呢?是接收,不是发送。
@fatedier commented on GitHub (Jan 10, 2021):
好像没有这个必要?既然前面挡了 nginx 的话,可以直接将 real IP 写到 header 中传递给 frps?
@renkx commented on GitHub (Jan 10, 2021):
现在是nginx设置了proxy_protocol on之后,分流给frps,就会error。错误日志我抽时间整理放上来。
@fatedier commented on GitHub (Jan 10, 2021):
frps 没有识别 PROXY_PROTOCOL,所以出错很正常的。我的意思是,没必要转发给 frps 的时候开启 PROXY protocol
@renkx commented on GitHub (Jan 10, 2021):
用nginx sni分流是因为有其他服务用到443,其他服务需要开启PROXY protocol获取真实IP信息,所以frps想共用443,必须要接收PROXY protocol才行。否则就error
@renkx commented on GitHub (Jan 10, 2021):
以上是某“爱国”core,有个acceptProxyProtocol:true的配置,就是为了开启PROXY protocol接收,接收nginx SNI分流前真实来源IP和端口。
我在想frps有没有这种设置
@fatedier commented on GitHub (Jan 10, 2021):
nginx 的配置应该是可以单独配置的?都用 443,但是不同 host 可以配置不同的转发规则把?发往 frps 的时候就不需要带上 Proxy protocol 了?
要支持的话也可以考虑,之后看一下怎么设计,你目前肯定直接优化 nginx 配置更快一些。
@EkkoG commented on GitHub (Jun 24, 2021):
刚正在配置一个场景,似乎和这个 issue 是同一个问题
这样配置的目的是让多个服务可以共用 443 端口
5011 和 5014 是两个 HTTPS 网页服务,单独访问没有问题,然后用 Nginx 分流,就不行了,我没找到错误日志,现在的现象是访问 home-emby.frp.xxx.com 时会得到 home-dsm.frp.xxx.com 的网页,或者反过来,总会有一个是不正常的
@fatedier commented on GitHub (Jun 25, 2021):
@cielpy 看起来不是一个问题,你能单独新建一个 issue 说明这个问题,以及我如何能在本地快速复现这个场景?
@EkkoG commented on GitHub (Jun 25, 2021):
确实不是同一个问题,但是我觉得这个问题可能不是在 frp,而是在 Nginx 那边,有人遇到和我一样的问题 https://www.orzlee.com/proxy/2021/04/13/nginx-sni-offload-port-multiplexing-uses-xray-vless-xtls.html
@aorosora commented on GitHub (Nov 6, 2021):
一样的情况,我现在是通过前置 FRPS,然后再在 Nginx 前套一个 FRPC 来曲线解决用户 IP 的传递问题的(就是服务器上同时安装了 FRPS 和 FRPC)。不过这样的话 V2Ray 就不能使用 gRPC 和 mux 了。
@picklefan commented on GitHub (Mar 2, 2022):
这个我好像会, 我是前置 Nginx sni, proxy_protocol on 之后 Xray 可以运行但是没有网, 删掉 proxy_protocol 之后 Xray 可以正常上网, 猜测是 Xray 无法识别 proxy_protocol 的 header, 后面找到一个解决方案就是在 stream 里面加个 proxy_pass, 加上 header 的数据 proxy_pass 之后就没有 header 了(maybe, 我猜的). 贴上我stream的部分配置
@Kissycat commented on GitHub (Sep 30, 2023):
还会考虑支持这个功能嘛,有这个功能的话,服务端和客户端的配置可以大大简化,只转发一个tcp端口就可以了,毕竟前后都可以让Nginx之类的去分流...
试了一下停更的nps,这玩意的tcp代理居然自动兼容proxy_protocol..
@rui8832 commented on GitHub (May 7, 2024):
我是这样配置的,多个域名共用一台服务器的443口,实际服务部署在内网,用frp穿透:
Nginx 配置:
内网 frpc 配置,主要是
remote_port与 Nginx 反向代理配置匹配:@zzz929625 commented on GitHub (Dec 11, 2024):
同样的需求,我也是nginx前置分流开启了proxy protocol,这两天疯狂排查,最后发现proxy protocol是断在了frp这里,我也有nginx sni开启proxy protocol的需求
@github-actions[bot] commented on GitHub (May 22, 2025):
Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.
@NotYoojun commented on GitHub (Jul 12, 2025):
前面的nginx可以是stream而非https,也就是说frps服务器并没有存储相关的ssl证书,没法解密tls流量,所以也不能写入header
@Bliod-Cook commented on GitHub (Jul 22, 2025):
非常需要这个功能