mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #270] frp透传后在nginx无法获取真实ip,该如何配置 #190
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#190
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 @GongDexing on GitHub (Mar 9, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/270
$remote_addr始终是172.17.0.1,$http_x_forwarded_for始终是空,请问frp这边要如何配置


@fatedier commented on GitHub (Mar 10, 2017):
暂时不支持。
@jearol commented on GitHub (Apr 6, 2017):
同样期待此功能
@openmynet commented on GitHub (Apr 23, 2017):
nginx
我后端是express框架写的是可以获取真实的用户IP的
@oldthreefeng commented on GitHub (Mar 13, 2020):
请问解决了么, 求一下配置.
@jearol commented on GitHub (Mar 13, 2020):
这需要在frp_server外面再加个nginx
本地PHP -> 本地Nginx -> 本地frp_client -> 远程frp_server -> 远程Nginx
只有前4个的话就会始终127.0.0.1,加上最后一个,并且在配置文件里加上proxy_set_header的相关参数就会拿到真实的客户端ip了
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;
Louis notifications@github.com 于2020年3月13日周五 上午10:51写道:
--
You may only be a person in this world,but for someone,you are the world.