mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3456] 获取真实IP问题 proxy_protocol_version = v2 #2766
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#2766
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 @rebootder on GitHub (May 29, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3456
Describe the feature request
客户端配置了
proxy_protocol_version = v2
然后 nginx
real_ip_header proxy_protocol;
set_real_ip_from 127.0.0.1/0;
real_ip_recursive on;
php里面获取的IP地址是 ::ffff:x.x.x.x
怎么是IPV6和IPV4的IP
服务器已经关闭了IPv6
客户端也关闭了IPV6
如何让IP只显示IPV4的
不要IPV6的
Describe alternatives you've considered
No response
Affected area
@rebootder commented on GitHub (May 29, 2023):
我自己解决了
我原先用的V0.27版本
更换最新版的 V0.49版本问题解决了
问题原因
php 打印 print_r($_SERVER);
[REMOTE_ADDR] => ::ffff:255.255.255.255
返回的IP地址为IPV6
我关闭了服务端和客户端的IPV6 问题依旧
网上找了半天资料都不行
然后想着换个版本试试 结果问题解决了
现在 [REMOTE_ADDR] => 255.255.255.255
能正常显示IPV4
@github-actions[bot] commented on GitHub (Jun 29, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@gaojianstyle commented on GitHub (Dec 5, 2023):
我也是这样的问题,nodejs下https获取不到真实ip