mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2029] nginx http2的问题 #1611
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#1611
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 @imlizi on GitHub (Oct 13, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/2029
Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
What version of frp are you using (./frpc -v or ./frps -v)?
0.34.1What operating system and processor architecture are you using (
go env)?centos 8.2Configures you used:
frps.inifrpc.ini服务器nginx配置
内网nginx
Describe the results you received:
内网机器上的nginx日志里,看到请求都是 http1.1
Describe the results you expected:
nginx日志里应该是http2才对
Additional information you deem important (e.g. issue happens only occasionally):
Can you point out what caused this issue (optional)
@fatedier commented on GitHub (Oct 13, 2020):
请确认下访问的客户端是否使用的 HTTP2 协议请求?
@imlizi commented on GitHub (Oct 13, 2020):
用Firefox看,是http2,然而内网的日志还是http1.1
@fatedier commented on GitHub (Oct 13, 2020):
对于 HTTPS 代理来说,frp 不会修改连接的任何内容,建议可以控制变量,尝试直接连接 nginx 或者使用 TCP 类型的代理来测试。
@imlizi commented on GitHub (Oct 13, 2020):
没明白是什么意思? 😳
@fatedier commented on GitHub (Oct 13, 2020):
通过控制变量法来做测试、调试,验证和找到可能的问题点在哪里。
@imlizi commented on GitHub (Oct 13, 2020):
我在外网nginx里加上
内网的nginx日志是http1.1, 如果不加,就是 http1.0, 跟这个有关系吗?
@fatedier commented on GitHub (Oct 13, 2020):
看起来你的问题可能和 frp 无关,建议学习下 nginx 相关的文档吧。
@imlizi commented on GitHub (Oct 13, 2020):
服务器上的nginx反代我去掉了,直接用frp监听443,可以吧?
nginx反代用http2似乎不太好
这个配置,我加上v2就挂,不加v2就没事。这是怎么回事呢?

@fatedier commented on GitHub (Oct 13, 2020):
proxy_protocol_version这个和你的需求没有关系,去掉即可,具体是什么作用,可以看文档。@imlizi commented on GitHub (Oct 13, 2020):
这个就不纠结了,直接用frps监听443,就OK了,可是获取不到真实IP了。
原先的使用外网的nginx用的是
这样内网的nginx日志里可以用 $http_x_real_ip或者 $http_x_forwarded_for 获取到真实ip,现在外网没了nginx的反代了。直接用frp,我看文档 获取用户真实IP 里就是加上了
为什么我一加就不行呢?
@Becods commented on GitHub (Oct 16, 2020):
nginx需要有相关的配置
个人认为没有必要应用HTTP2到服务器nginx
看了一下nginx代理配置,并无写与HTTP2相关内容
正确配置应加上proxy_http_version 2;
此外,没必要再多套一层nginx或者frp
猜测源拓扑:
内网nginx→服务器nginx→frpc→frps个人推荐拓扑:
内网nginx→frpc→frps或内网nginx→服务器nginx@peaceanddemocracy commented on GitHub (May 30, 2022):
这个proxy_protocol的配置在nginx的conf文件中加在哪个位置的?可以给个参考示例么,默认443端口和80端口的