mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1164] get real user's ip in https environment by using proxy protocol #910
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#910
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 @dreamren on GitHub (Mar 27, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1164
Because I only have an HTTPS service in an Intranet environment, I want to get the user's real IP when the FRP-side inexistence webserver. FRP can support that by proxy protocol. Nginx has long provided proxy protocol support. Note that in this case the Intranet webserver does not provide the standard HTTPS service, but the FRP server can provide the standard HTTPS service.
Thanks.
@fatedier commented on GitHub (Mar 27, 2019):
Your https service in the Intranet support proxy protocol ?
I think it's not widely used, but it's ok to support it with a low priority.
@dreamren commented on GitHub (Mar 27, 2019):
Yes. I use these config in my Intranet nginx server:
http{
server{
listen unix:/dev/shm/localweb.sock ssl http2 proxy_protocol;
port_in_redirect off;
set_real_ip_from unix:;
real_ip_header proxy_protocol;
real_ip_recursive on;
proxy_set_header X-Real-IP $proxy_protocol_addr;
proxy_set_header X-Fowarded-For $proxy_protocol_addr;
#...
}
}
It's really not widely used, thanks for the support plan!
@fatedier commented on GitHub (Apr 10, 2019):
Supported in v0.26.0 .
@nimeia commented on GitHub (Apr 13, 2019):
in v0.26.0 . not work
the nginx error log
2019/04/12 11:12:15 [error] 29287#0: 73 broken header: "GET /zh-cn/download/ HTTP/1.1^M
Host: xxxxxx
Connection: keep-alive^M
Cache-Control: max-age=0^M
Upgrade-Insecure-Requests: 1^M
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36^M
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/*;q=0.8,application/signed-exchange;v=b3^M
Referer: http://xxxxxx/zh-cn/about/^M
Accept-Encoding: gzip, deflate^M
Accept-Language: zh-CN,zh;q=0.9^M
Cookie: _ga=GA1.2.1963277611.1554879062; _gid=GA1.2.2122501751.1554879062; Hm_lvt_0651a3006aeb268825e1fac075608b40=1554879071; Hm_lpvt_0651a3006aeb268825e1fac075608b40=1554994467^M
^M
" while reading PROXY protocol, client: x.x.x.x, server: 0.0.0.0:80
2019/04/12 11:12:40 [notice] 29318#0: signal process started
@dreamren commented on GitHub (Apr 17, 2019):
Thanks, When my nginx listens on a port, it works. But when nginx listens on a UNIX domain socket, it has a problem.
Nginx configuration:
frpc.ini:
Browser access to port 433 is normal, but port 1433 and 2433 don't work.
Attachment is nginx error log(The domain name involved has been replaced with xxx.xxx)
nginx_error.log
@fatedier commented on GitHub (Apr 17, 2019):
Not suppoted with plugin.
I need to consider how to implement it.
@nimeia commented on GitHub (Apr 19, 2019):
i find it can`t work in openresty (nginx sub tree), it work when i change to nginx. thank you