[GH-ISSUE #3319] 配置使用https2http时,http server 拿到的X-Forwarded-For ip地址是frps 的ip,而不是用户真实ip #2659

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

Originally created by @ablegao on GitHub (Feb 19, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3319

Bug Description

配置使用https2http时,http server 拿到的X-Forwarded-For ip地址是frps 的ip,而不是用户真实ip

frpc Version

0.47.0

frps Version

0.47.0

System Architecture

linux/amd64

Configurations

ftpc.ini:

       [common]
       server_addr = rp.xxxx.com
       server_port = 7888

       tls_enable = true
       tls_cert_file = ssl/client.crt
       tls_key_file = ssl/client.key
       tls_trusted_ca_file = ssl/ca.crt


       [relays_http]
       type = http
       local_ip = 127.0.0.1
       local_port = 7447
       remote_port = 80
       custom_domains = hub01.xxxx.com
       health_check_url = /
       health_check_timeout_s = 3
       health_check_max_failed = 3
       health_check_interval_s = 10

       [relays_https2http]
       type = https
       ; header_X-From-Where = frp
       custom_domains = hub01.xxxx.com
       remote_port = 443
       plugin = https2http
       plugin_local_addr = 127.0.0.1:7447
       plugin_crt_path = ./hub01.xxxx.com/fullchain1.pem
       plugin_key_path = ./hub01.xxxx.com/privkey1.pem
       plugin_host_header_rewrite = hub01.xxxx.com
       plugin_header_X-From-Where = frp
       plugin_host_header_rewrite = 127.0.0.1

frps.ini:

        [common]
        tls_only = true
       vhost_https_port=443
       vhost_http_port=80
       bind_port = 7888
       tls_enable = true
       tls_cert_file = server.crt
       tls_key_file = server.key
       tls_trusted_ca_file = ca.crt

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 @ablegao on GitHub (Feb 19, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3319 ### Bug Description 配置使用https2http时,http server 拿到的X-Forwarded-For ip地址是frps 的ip,而不是用户真实ip ### frpc Version 0.47.0 ### frps Version 0.47.0 ### System Architecture linux/amd64 ### Configurations ftpc.ini: [common] server_addr = rp.xxxx.com server_port = 7888 tls_enable = true tls_cert_file = ssl/client.crt tls_key_file = ssl/client.key tls_trusted_ca_file = ssl/ca.crt [relays_http] type = http local_ip = 127.0.0.1 local_port = 7447 remote_port = 80 custom_domains = hub01.xxxx.com health_check_url = / health_check_timeout_s = 3 health_check_max_failed = 3 health_check_interval_s = 10 [relays_https2http] type = https ; header_X-From-Where = frp custom_domains = hub01.xxxx.com remote_port = 443 plugin = https2http plugin_local_addr = 127.0.0.1:7447 plugin_crt_path = ./hub01.xxxx.com/fullchain1.pem plugin_key_path = ./hub01.xxxx.com/privkey1.pem plugin_host_header_rewrite = hub01.xxxx.com plugin_header_X-From-Where = frp plugin_host_header_rewrite = 127.0.0.1 frps.ini: [common] tls_only = true vhost_https_port=443 vhost_http_port=80 bind_port = 7888 tls_enable = true tls_cert_file = server.crt tls_key_file = server.key tls_trusted_ca_file = ca.crt ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:43:02 -06:00
Author
Owner

@Becods commented on GitHub (Feb 20, 2023):

Get Real IP

<!-- gh-comment-id:1436289036 --> @Becods commented on GitHub (Feb 20, 2023): [Get Real IP](https://github.com/fatedier/frp#get-real-ip)
Author
Owner

@github-actions[bot] commented on GitHub (Mar 23, 2023):

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

<!-- gh-comment-id:1480425246 --> @github-actions[bot] commented on GitHub (Mar 23, 2023): 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#2659
No description provided.