mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4640] FRPS日志中有没有可能记录得到请求头传递的地址 #3666
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#3666
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 @somnifex on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4640
Describe the feature request
我在FRPS服务后套nginx反代端口,这种情况下frps日志中获取的访问ip是127.0.0.1,我想构建一套统一基于frps.log的fail2ban规则,想请问一下frps中有没有可能在日志中获取真实访问ip。(这是一个求助issus,不是功能请求,因为我知道这种fail2ban的用法不符合一般的规范,只是我的个人情况,合理的方案应该是对nginx日志进行分析从而执行ip ban)
Describe alternatives you've considered
No response
Affected area
@potoo0 commented on GitHub (Jan 17, 2025):
单纯讨论 http 代理的话,是能获取到的。代码这里 req 就是客户端请求,header / path / queryparams 等都可以在这里获取到。一般来说 http(s) 代理会通过 header(
X-Forwarded-For/X-Real-IP) 传递真实 ip,所以这里可以req.Header.Get("X-Forwarded-For")。而对于 tcp 连接,debug 日志已经包含了,userConn.RemoteAddr()。
我现在的方案是:
自定义的 action:
然后在目标 jail 里配置:
banaction = remote,如:@somnifex commented on GitHub (Jan 17, 2025):
看起来是一种解决方案,俺研究一下
@potoo0 commented on GitHub (Jan 17, 2025):
fail2ban-client 的文档
@github-actions[bot] commented on GitHub (Feb 1, 2025):
Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.