[GH-ISSUE #2951] X-Forwarded-For type https, the value is IP Server, Not IP Visitor #2358

Closed
opened 2026-05-05 13:31:08 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @mafaza86 on GitHub (May 25, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2951

Bug Description

Thank you frp very helpful and amazing...

I have problems getting the visitor's IP address, I read the ip with the "X-Forwarded-For" header, which appears not the visitor's ip, but the server's ip. Here's my config:

access http//:web01.tunnel.example.com X-Forwarded-For contains visitor ip

access https://:web01.tunnel.example.com X-Forwarded-For contains the server ip, so it cannot know the real ip address of the visitor.

*I don't use proxy / nginx

Thanks very much

frpc Version

0.42.0

frps Version

0.0.2

System Architecture

linux/amd64

Configurations

frps.ini
[common]
bind_addr = 0.0.0.0
bind_port = 7000

vhost_http_port = 80
vhost_https_port = 443

frpc.ini
[common]
server_addr = 103.226.138.188
server_port = 7000

[web01https]
type = https
local_ip = 127.0.0.1
plugin = https2http
plugin_local_addr = 127.0.0.1:5050
plugin_crt_path = ./fullchain.pem
plugin_key_path = ./privkey.pem
subdomain = web01
custom_domains = tunnel.example.com

[web01http]
type = http
local_ip = 127.0.0.1
local_port = 5050
subdomain = web01
custom_domains = tunnel.example.com

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @mafaza86 on GitHub (May 25, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2951 ### Bug Description **Thank you frp very helpful and amazing...** I have problems getting the visitor's IP address, I read the ip with the "X-Forwarded-For" header, which appears not the visitor's ip, but the server's ip. Here's my config: access http//:web01.tunnel.example.com X-Forwarded-For contains visitor ip access https://:web01.tunnel.example.com X-Forwarded-For contains the server ip, so it cannot know the real ip address of the visitor. ***I don't use proxy / nginx** Thanks very much ### frpc Version 0.42.0 ### frps Version 0.0.2 ### System Architecture linux/amd64 ### Configurations frps.ini [common] bind_addr = 0.0.0.0 bind_port = 7000 vhost_http_port = 80 vhost_https_port = 443 frpc.ini [common] server_addr = 103.226.138.188 server_port = 7000 [web01https] type = https local_ip = 127.0.0.1 plugin = https2http plugin_local_addr = 127.0.0.1:5050 plugin_crt_path = ./fullchain.pem plugin_key_path = ./privkey.pem subdomain = web01 custom_domains = tunnel.example.com [web01http] type = http local_ip = 127.0.0.1 local_port = 5050 subdomain = web01 custom_domains = tunnel.example.com ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 13:31:08 -06:00
Author
Owner

@fatedier commented on GitHub (May 25, 2022):

X-Forwarded-For can't be supported fro HTTPS.

You can try proxy-protocol instead.

<!-- gh-comment-id:1137329280 --> @fatedier commented on GitHub (May 25, 2022): `X-Forwarded-For` can't be supported fro HTTPS. You can try [proxy-protocol](https://github.com/fatedier/frp#proxy-protocol) instead.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 25, 2022):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1166153566 --> @github-actions[bot] commented on GitHub (Jun 25, 2022): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2358
No description provided.